AX 2012: How to open a form in X++

Posted on Updated on

Using FormRun:

void clicked()
{
    Args    args;
    FormRun formRun;
	
    args = new Args(formstr(CustTable));
    args.record(custTableLocal);
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.wait();
    formRun.detach();
    CustTable_DS.research();
}

Using MenuFunction:

void clicked()
{
    Args args;
	
    args = new Args();
    args.caller(this);
    args.parmObject(list);
    new MenuFunction(menuItemDisplayStr(SalesTable), MenuItemType::Display).run(args);
}
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s