Skip to content

X++ code to open a form or menuitem

how to open a form by using x++ code:

static void OpenDisplayMenuItem()
{
Args args = new Args();
;
args.record(VendTable::find("XYZ"));
new MenuFunction(MenuItemDisplayStr(VendTable),MenuItemType::Display).run(Args);
}

static void OpenForm()
{ 
FormRun formRun;
Args args = new Args();
;
args.name(formstr(VendTable));
args.record(CustTable::find("XYZ"));
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}

Published inTechnical SQL