X++ code to open a form or menuitem AXAPTA
How to open a form by using x++ code.
- static void OpenDisplayMenuItem()
- {
- Args args = new Args();
- ;
- args.record(VendTable::find('A-CSK'));
- new MenuFunction(MenuItemDisplayStr(VendTable),MenuItemType::Display).run(Args);
- }
This Job will get the same result but with different approach by using formrun class.
- static void OpenForm()
- {
- FormRun formRun;
- Args args = new Args();
- ;
- args.name(formstr(VendTable));
- args.record(CustTable::find('A-CSK'));
- formRun = ClassFactory.formRunClass(args);
- formRun.init();
- formRun.run();
- formRun.wait();
- }
No comments:
Post a Comment