how to pass Parameter from Page List to Menu Item

Hi All,

I have a SSRS Report, Produce Report Base on SalesID in SalesTable. I embedded the Report behind the menu item in the ribbon of “All Sales Order”. i want to choose one of the sales order and click on menu item to print the report for me. So, how can I pass The SalesID parameter to Print Menu Item?

any help would be welcomed!

Which version of AX? If AX 2012, do you have sales ID as a separate parameter or is your goal to add a range to a query?

It’s AX 2012 R2. No I don’t want it as a range. I want pass it as a separate parameter from sales table pagelist to the menu item. TanQ for your respond

Hi Monir,

Do do this U need to create a new class extend it srsReportRunController class and override the prePromptModifyContract method Like

protected void prePromptModifyContract()

{

Query query;

QueryBuildDataSource qbds;

Salestable salesTable;

salesTable= args ? args.record() as salesTable: null;

if (salesTable.RecId)

{

//get the query associated with the report

query = this.getFirstQuery();

qbds = query.dataSourceTable(tableNum(Salestable ));

qbds.addRange(fieldNum(salestable ,salesID)).value(salestable .SalesID);

}

}

create New main method in the class and call the report from there like

public static Void main(_args)

{

Myclass mc = new Myclass();

mc.ParmReportname(srsReportstr(reportname,reportdesignname));

mc.Parmargs(_args);

mc.startOperation();

}

assign this class in a action menuItem to the form and assign datasource property as SalesTable …

Great, it’s work.

TanQ vinothkumar