Skip to main content

Notifications

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 ?

  • Verified answer
    Martin Dráb Profile Picture
    233,710 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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Martin Dráb Profile Picture

Martin Dráb 487 Most Valuable Professional

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 310

#3
Saalim Ansari Profile Picture

Saalim Ansari 291

Overall leaderboard

Product updates

Dynamics 365 release plans