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 :
Microsoft Dynamics AX (Archived)

How to get the action menuitem from a class name ?

(0) ShareShare
ReportReport
Posted on by

For a security purpose I want to have the menuitem associated for a class.

I Looked in the Init method from the SysSetupForm class but when the source is a class...it can't get the menuitem, only the class name :(

Do you have an idea to get this menuitem?

*This post is locked for comments

I have the same question (0)
  • dynamics developer Profile Picture
    2 on at

    Hi,

    In the class can you store the caller menu item name in a parm method and use it in the called form? or even pass the name as an argument to the form?

  • Community Member Profile Picture
    on at

    that would be a good option if it were for only 2-3 classes, but I want to be as generic as it could, since I could retreive the menuitem from any classes called from a menuitem in the system

  • Hariharans87 Profile Picture
    3 on at

    Do you want to find that which menu item is using a particular class?

  • Community Member Profile Picture
    on at

    No I want to find a particular menuitem from a particular class or classname

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    Can you please elaborate what you're trying to achieve? The remark about SysSetupForm suggests that your requirement is somehow related to forms, but I'm not sure what you intend to do there.

    Does it mean that you have a class between the menu item and the form and you want to find the menu item calling the class at runtime? If so, you have to look at Args received in the main method of the class. The form doesn't receive such information (unless the class exposes it to the form).

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    If all you have is a class name, there may be many menu items pointing to the same class. Assuming that there is just one would be wrong.

  • Hariharans87 Profile Picture
    3 on at

    Want to find a particular menu item means?

  • Community Member Profile Picture
    on at

    Hi Martin, what I want to do, is to modify the SysSetupForm Form to show, whatever the source is, the menu item. The goal with that customization is the facilitate the process to determine wich privilege my users need in their duties to access a particular form/runbase/report etc.

    like in this case: I would need to check the menu in the AOT the find the menuitem

    80445.Capture.JPG

  • Martin Dráb Profile Picture
    237,948 Most Valuable Professional on at

    You still didn't describe your scenario - I assume that the form is open by code, not a menu item, so there is no menu item to show. That the class calling the form was open by menu item is a different topic; the form doesn't know anything about it. Also, if the class didn't save information from Args received in the main() method, even the class doesn't know what (if) menu item was used.

    To understand what permissions are needed, use the recording functionality of the Security Development Tool.

  • Community Member Profile Picture
    on at

    I don't have a specific scenario, because I want to retreive any menuitem from any form. Probably more chances the form is open by a menuitem.

    My context is...It won't be a developper as me that would retreive the privilege needed, I want to be as easy as possible for my customers to adjust their roles without going in the AOT or in the security development tool. And to acheive that they need to find out the source privilege of any form they want to access.

    My problem is that many RunBase form or SysOperationForm doesn't show the menuitem in the Personalize form (SysSetupForm)

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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans