web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

Open Form and Menu Item through X++ Security

(0) ShareShare
ReportReport
Posted on by 77

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 ?

I have the same question (0)
  • Verified answer
    Martin Dráb Profile Picture
    237,987 Most Valuable Professional on at

    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())
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans