web
You’re offline. This is a read only version of the page.
close
Skip to main content
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
    236,045 Most Valuable Professional on at
    RE: Open Form and Menu Item through X++ Security

    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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

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

#1
CA Neeraj Kumar Profile Picture

CA Neeraj Kumar 895

#2
Sohaib Cheema Profile Picture

Sohaib Cheema 811 User Group Leader

#3
André Arnaud de Calavon Profile Picture

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

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans