add new button and connect with a report

ernesternest Member Posts: 162
Hi all

I have created a new button in the Sales Quote form. I created this button by doing copy/paste the print button.
I have also create a new report in the system and i want to connect this new button with this report.

Can anyone please tell me how to do that??

Thank you and best regards

Comments

  • hemantOnehemantOne Member Posts: 98
    Hi,

    you can see any standard Report.

    Set Push Action Property of command button to RunObject and set Run Object Property to your report....
    Regards,
    Hemant
    They can conquer who believe they can
    .
  • ernesternest Member Posts: 162
    Hi Hemant

    I did as you suggested, but it is not working. the button is still executing the sales quote report and not the report which i set on the RunObject property.
    If you have any other suggestion please do so.

    Thanks again
  • SogSog Member Posts: 1,023
    delete the button and follow these steps, because I think there is code behind the button you copied and I don't know if you are able to edit code:
    1: open the toolbox (the hammer and srewdriver-icon)
    2: Select command button (grey rectangle)
    3: click on your form
    4: select the new created button and open it's properties (shift+f4 or page with checkmark on-icon)
    5: in the properties screen, look for pushaction and set it on runobject
    6: in the runobject property set your desired report to run
    7: save and exit.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • hemantOnehemantOne Member Posts: 98
    Hi

    yes, sog is correct if you use copy existing command button than you must delete the code behind that...otherwise follow --


    delete the button and follow these steps, because I think there is code behind the button you copied and I don't know if you are able to edit code:
    1: open the toolbox (the hammer and srewdriver-icon)
    2: Select command button (grey rectangle)
    3: click on your form
    4: select the new created button and open it's properties (shift+f4 or page with checkmark on-icon)
    5: in the properties screen, look for pushaction and set it on runobject
    6: in the runobject property set your desired report to run
    7: save and exit.

    Thanks
    Regards,
    Hemant
    They can conquer who believe they can
    .
  • ernesternest Member Posts: 162
    Hi all

    I created the new button from the beginning but now i am having to problems.
    First when i open the form in all page (press the Maximize button in the top-right corner of the window) my button is disappearing, and it is showing only when when i close Navision and open it again.

    Second, i want to sales quote number to be passed automatically on the report parameter, because this way it is showing all sales quotes.

    Thanks again
  • SogSog Member Posts: 1,023
    go back to design your form
    for the button set the following properties for compatibility with maximalisation
    horzglue = right (normally left)
    vertglue = bottom (normally top)
    This will glue your button to the right and bottom side of your form.

    for the parameter edit following property "runFormOnRec" to true.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • ernesternest Member Posts: 162
    Hi Sog

    Thanks for your answers. The first problem is gone now. =D>

    But the parameter, problem is still there even i set the "runFormOnRec" to Yes. :(

    Do you have any suggestion?

    Thanks again
    Ernest
  • SogSog Member Posts: 1,023
    The new suggestion would be code.
    I've checked the help file for reference (I recommend you do that too) and the runform... actions only apply if the object you try to run is a form. Which means adding the parameter to the report can only happen in code.
    Cfr: search mibuso on report.runmodal
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • ernesternest Member Posts: 162
    Hi Sog

    The reason why i tried to do copy/paste the print button of the form is because my report is a new sales quote, only that is translated in Albanian language.
    So basically is the same report as sales quote only are translated the fields in this report, that's why i wanted all the functionality of this button the same as the Print button which is actually on the Sales Quote form, but only to be connected with the new Sales Quote report translated by me.

    If you can help me on this, it would be great.

    Thank you and best regards
    Ernest
  • SogSog Member Posts: 1,023
    So you don't need the old sales quote report?
    In that case, you should edit the S-Quote line in the report selections form.
    Go to Sales & Marketing, order processing, setup, report-selection sales.
    edit the list-id from 204 to the id of your report.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • crisnicolascrisnicolas Member Posts: 177
    Or... instead of having a new report, just use the old one with the translation on captions...
  • ernesternest Member Posts: 162
    No i need even the old report.
    I have added a new button so the user can choose if he is going to print the sales quote in English, or the sales quote in Albanian which should be executed with the new button added.


    Thanks to all
  • SogSog Member Posts: 1,023
    How about this? if you add to the report selections the Albanian quote, ie: sequence = 2, report id = albanian Quote ID
    The users prints as usual, and 2 reports will pop-up (after eachother, not at the same time). The english sales quote and the albanian sales quote. if he wants the english report he can print the first report that pops up, and cancel the second, else vice versa.

    But now I have to agree with crisnicolas, if you edit all the ML captions of the labels in the original sales quote, you can have support for Albanian and English based on the customer language, and no user interaction is required. (Fe: CaptionML of label: enu="english translation",alb="albanian translation" //I dont know any Albanian or the Albanian Language code, sorry)
    If that is impossible, then I would go for the suggestion I made.
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
  • crisnicolascrisnicolas Member Posts: 177
    You can do that with a single report and without having to print both languages.
    Use the CurrReport.LANGUAGE function to change the language in which the report will be printed.
    Take a look at how this function is used in report 205, Sales Header dataitem
Sign In or Register to comment.