28 Jan 2015

Pass values between form and report +AX

Here is for example the code of the button that calls the report:

void clicked()
{
Args args;
ReportRun reportRun;
;
super();
args = new Args();
args.name(Reportstr(HistoryHolidays));
args.parm( LogId );
reportRun = classfactory.reportRunClass(args);
reportRun.init();
reportRun.run();
reportRun.wait();
args.parmObject( args );
}

in the init method of your report try this:

public void init()
{
if( element.args() )
{
logId = element.args().parm();
}
super();
}

then you can use this parameter in your report form example:

public void executeSection()
{
;

if ( employee_1.LogId == logId)
{
emplId = employee_1.empId;
super();
}
if ( logid == "1")
{
emplId = DropHoliday_1.EmpId;
super();
}

}

No comments:

Create number sequence in D365 FO

Create the data type. Add code in the loadModule method of the appropriate NumberSeqModule subclass. Add a method to the module’s paramet...