Report from button


I have created the report. Now I want to run it with the button on form “SalesTable”, which retrieves the value of the selected record in the grid ?

For example, when I press the button, it will open a report created by me for the field “SalesId”

How can I do this?

Best Regards

Hi Arek,

In init method of the report, you have to use the code as element.args().record which will retrieve the current record which you have selected…:slight_smile:

Also, you can see the standard report fot this…

For example, PurchPurchaseOrder report, see the init method

else, in InventTransferReceive Report, see the initfromcaller method…You will come to know the requirement you want…


Pass the elements.args().record into the Salestable


Do you have a simple example of this?


U can check for ‘BankAccountStatement’ form or ‘BankTrans’ standard forms ,in print option u can open the reports…look into that reports.


I,m not AX programmer so I’m little confiused in this code. Where shoud I write sentence “element.args().record” and what write i method INIT in report (how to build report to work wit this?)


hi ,

Declare the table in class declaration as SalesTable salestable1;


In Init() write salestable1= element.args().record();