Calling/Opening AX form through X++
Sample piece of code to open AX form through X++
If you want to pass a record to open a form
static voidOpenForm_ThroughCode(Args _args)
{
Args args;
Object formRun;
// open form
args = new Args();
args.name(formstr(FormName));
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}If you want to pass a record to open a form
args = newArgs();
args.record(ProjTable::find('PR00001'));
args.name(formstr(FormName));
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
How to retrieve these args on caller form's init()
{
ProjTable projTableLocal;
super();
projTableLocal = element.args().record();
}
*This post is locked for comments