Open Popup form from X++ code from display menu item in D365FO

 Hi,

Open Popup form from X++ code from display menu item in D365FO

https://community.dynamics.com/365/financeandoperations/f/dynamics-365-for-finance-and-operations-forum/288915/open-form-in-new-window-via-x/850917


create a menu item for the form that you want to open and use the normal way to secure the menu item with security. Then, you can launch the form using the menu item.

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



another sample


if (_args || _args.record() || _args.dataset() == tablenum(PurchTable)) { PurchTable _purchTable =_args.record();

new MenuFunction(MenuItemDisplayStr(POPopUpTmpForm),MenuItemType::Display).run(_args);


}


To open with filtered selection from Source Form to Destination form


You can use this code,

    Args      args  =  new Args();

    FormRun   formRun;

    VendTable vendTable_filtered;

;

    select vendTable_filtered where vendTable_filtered.AccountNum == "KRISHNA0001";

    args.name(formstr(VendTable));

    args.record(vendTable_filtered);

    formRun = classfactory.formRunClass(args);

    formRun.init();

    formRun.run();

    formRun.detach();


Comments


  1. You made a very helpful article. I appreciate you blogging about it. I hope you keep having success. erp custom software

    ReplyDelete

Post a Comment