Pass Array one form to another form in ax 2012

Description: Here I have given simple demonstration to pass array one form to another in ax 2012. You can pass String, Container, Class, BLOB, Date, Enum, Integer, Int64 etc...

Here I have given string array example to pass array Object in one form to another form in ax 2012. On your button click event create initialize array object and store you want to store string value.

Form-1 Button click event.

Args    args = new Args();
Array   items = new Array( Types::String );
super();

items.value(1,strFmt("%1",Custtable.AccountNum));
args.parmObject(items);
args.name(formstr(FormName));
args.caller(this);
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
formRun.detach();

Form-2 Form init method.

Array   items;
Str 20 _CustAcc;
super();
if(element.args().dataset())
{
   if(element.args().parm())
   {
      items = element.args().parmObject();
      _CustAcc = items.value(1);
   }
}

Related Posts

Previous
Next Post »

Thanks for comments.....