Microsoft_MVP_banner

Calling/Opening AX form through X++

Sample piece of code to open AX form through X++

static void
OpenForm_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 = new
Args();
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()

public void
init()
{
    ProjTable   projTableLocal;   
    super();   
    projTableLocal
= element.args().record();   

}

Share:

Send Us A Message

Leave a Reply

Your email address will not be published. Required fields are marked *

FaisalFareed@2025. All rights reserved

Design by T3chDesigns