Passing parameters from a form to a report

I have a form which has two string edit fields.I need to show a report based on the account number entered in these field for example


Field 1 =“1101”

Field 2 =“1200”

then my report needs to print all customer details whose account number is between the above range.I do not want to use the range and parameter needs to be passed only through code.

How can i achieve this?Please advice.

You maybe write while select loop with where condition (like between) then display method for display cust name or Id

You need to use arguments. Check the init method of Reports\SalesInvoice to get started.

STEP 1) create a menu item ,set PROPERTIES a)OBJECT TYPE:-REPORT

b) OBJECT :-(Name of the Report)

C) name: REPORT123

STEP 2) place a Menu button in FORM ,set PROPERTIES



STEP3) iNIT METOD IN report ,


if(element.args().dataset() == tablenum(TableNAME))


_TABLENAME = element.args().record();


YOU WILL GET THE CURRECT aCTIVE RECORD IN “_TABLENAME” table buffer.Then you can select the record using the table buffer;





All these things are possible if you are using a table in the form(temp or permanent table)[:)]

I have uploaded objects to implement passing parameter from one object to another. you can download it from here.


In the code unit dont forget to set the single instace property.

kathik. D

Its is DynamicsAx.I think u send link for “Navision”.Check the post and link

Thanks guys.Will post the refined Code soon.