AX – D365FO – How to access Args Parameters inside dialog() in a runbasebatch class?

I want to pass the Args.parm() value from Main() method of a RunBaseBatch to the dialog() method of the same RunBaseBatch.

First of all declare a new string variable called “argsParm” in the declaration method of the RunBaseBatch class and add it to the #localMacro.CurrentList macro

/// </remarks>

class TaxReport extends RunBaseBatch
   NoYes                   updateNow;
   TaxPeriod               taxPeriod;
   str                     argsParm;






Then create a new method parmArgsParm() in order to access the variable

public str parmArgsParm(str _argsParm = argsParm)
   argsParm = _argsParm;

   return argsParm;

Then in the Main() method create a new instance of the class and call the parmArgsParm() passing the _args.parm() value

server static void main(Args  _args)


   TaxReport                       taxReport;

   NoYes                           updateNow;

   TaxPeriod                       taxPeriod;

   taxReport = new TaxReport();



   if (taxReport.prompt())


       updateNow         = taxReport.update();

       taxPeriod         = taxReport.taxPeriod();

       fromDate          = taxReport.fromDate();

       transactionDate   = taxReport.transDate();

       settlementAccount = taxReport.parmSettlementAccount();

       taxRepVersion     = taxReport.taxRepVersion();


Then in the dialog() method you can obtain the argsParm value and do what you want

Object dialog()


   DialogRunbase dialog = new DialogRunbase("@SYS23178", this);

   updateNow = false;

   if (argsParm == 'custom')






Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s