Hi Guys,
i need to open form through X++ code ,, what's better i open the form from X++ or open the menu item which refer to the form ?
also i wonder the target form has a menu item and privilege refer to menu item .. if i open the form directly through code it will not apply the security right ?
Using a menu item is usually better - security is set up for menu items, not forms, and menu items may have additional properties (e.g. an enum parameter value).
You could do something like this:
MenuFunction menuFunction = new MenuFunction(menuItemDisplayStr(YourMenuItem), MenuItemType::Display); if (hasMenuItemSecurityAccess(menuFunction)) { menuFunction.run(new Args()) }
Martin Dráb
487
Most Valuable Professional
Abhilash Warrier
310
Saalim Ansari
291