Adding a menu item to a form


I have created a report and added it to the sales quote form, however the specific quote no. is not filled in the filter. I have looked but can not see the way of putting the no field entry automatically.

We do not have the license to make code for forms !

Any ideas


Michael M

I don’t know if you have access to codeunits. You could for example call a codeunit and that codeunit would call that report.

If that report is to replace standard quote report, you can configure it in report selection.

Hi Nuno

thanks for the reply, unfortunately we don’t have access to code units. The report is an extra menu item. It looks at the costs and selling prices, and also allows us to manipulate the exchage rates to show if we achieve a better margin with the strong £ exchange rate etc.

However the problem is still I can not seem to link the form to run the report of that record.



If I’m not in mistake you really need to use C/AL to filter report by key. There are 2 ways of achieving that, but you need C/AL.

If they can’t access code in forms, then they also wont have access to CodeUnits right [;)]

You can probably do this with you license, like this.

Create a new report, go to the Requisition form designer. assigning table 36 to the form. Add a button that will print the report you want. Add code as required, and make sure that any required variable are added locally to the button. Copy the button. Open the Form you want to design, and paste the button, the code should be pasted with it.

A second option is to use a report as a code unit, and add code there to call the correct report.

You probably are right. [:D]
I don’t have a reduced license. So I could confirm it

This don’t lead to the same problem of don’t having permission to edit codeunits?

what about going to the report selection section and assigning your report to the sales quote

Administration → Application Setup → Sales & Marketing → Report Selections

then when you print the quote, it should print the report.

From what I have understood isn’t possible to do that, because it’s a new report in a new menu item and not a report to replace existing quote report.

I think you need to have the sales header as a data item in the report. But if you are running a report based on the quote you probably have the sales header table in the reports anyways,

Just as a test, I copied the existing sales quote to a new number and name in my user range, I then changed the report to include different data items, leaving the sales header as the first data item, my new report containing links to the item table ect, I was able to be assigned it to the sales quote report selection screen and print it with a regualar quote.

So, I think it is a matter of creating the report correctly, Not knowing anything about his report or what tables it is accessing I am not sure, but you can assign new users created reports in the report selection routine and have them print.

and it you can create reports, then you have access to most of the cal code, since you can access it in report with the basic report designer.

Dear All

the report is based of the sales header and sales lines. It is an additional report to the sales quotation. I have created this report as an internal costing sheet. Its shows costs LCY, sales prices, g/l entries, resources all in seperate sections. I have added it to the command button “Print” as a menu item. It will link ok, but the No. filter (the card that is open) is not populating, so I have to do this manually. The only thing I can think of is getting the report to look at the open form to see the number is this possible?



Can you explain why my solution did not work?

PS in reality the suggestion that themave made is really the correct way to do this, but I guess in this case you need to run the new report separately to existing report in which case just add a new button as I suggested above.

We think this is a very clever way to get code over to a form but we are not sure the lines of code that should go behind the button to get the Quote number off of the form and into the Report Filter. Any help would be appreciated. We assume the code should go in the ‘Sales Header - OnPush’ event of the button in the report’s request form and then be copied to the target form.

He’s a replay from a post that asks basically the same question.

I needed to run a report (#50065) from a PO that would update some sales lines.
All I wanted is that the PO# appeared in the report so no user intervention was needed.

The only way I could do it was on the c/al code of the button

then I added to Codeunit229 (Document-Print) a function called UpdateSalesLines
But it’s the last 3 lines of code that gets your report going & without a dev license you would need to have your nsc do this for you.

UpdateSalesLines(PurchHeader : Record “Purchase Header”)
PurchLine.SETRANGE(“Document Type”,PurchHeader.“Document Type”);
PurchLine.SETRANGE(“Document No.”,PurchHeader.“No.”);
PurchHeader.GET(PurchHeader.“Document Type”,PurchHeader.“No.”);

ReportSelection.SETFILTER(“Report ID”,’<>0’);