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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Is there a way know Menu item button belong to a Form?

(0) ShareShare
ReportReport
Posted on by 130

Hello everyone,

Im working on AX 2012 R2 CU6 security task using Security Development Tool. I'm facing 2 issues:

1. Is it possible to export the MenuTree in Security Development Tool when Role is selected and how to do that?

2. How can I get the parent form of a menu item? Ex: I have menu button A, how can I get the form that contains the menu button A?

Thank you.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Faisal Fareed Profile Picture
    10,796 User Group Leader on at

    Hi Long,

    1. You can get such information from AOT as treeview control itself does not store anything in tables which You can read and export. However, you can go to particular role in AOT and right click | add-ins | Security tools | View related security objects. There is a button to export these into excel

    2. Right click menu item in AOT | Add-ins | Open new windows | Open used form

  • Long.Thai Profile Picture
    130 on at

    Hi Faisal,

    Thank you for fast response. But I have to do all this by code. 

    I have built a tool to export all permission and menu path of selected Security Roles. It worked well but I cant get deeper into the Form's buttons.

    4604.Untitled.png

    Like this, I just only can get the path of Menus, but i also want to get the menu items in those Forms too. Thats my problem. 

    Ex: The "button - load to do pattern" is shown in "Form B". All I want is the menu path of that, like "Module A/Inquiries/Form B/Button - Load to do pattern".

    Any ideas?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi LongTNH,

    Can you please share me . how are you extracting these details from AX tables.

    I need data in below format.

    Module/Area/menu/menu-item/View Cal and Maintain CAL details .

    Thanks in advance

  • Suggested answer
    Long.Thai Profile Picture
    130 on at

    Hi Aakash,

    You can have that by using Security Development tools. I used that tool and implemented the code of Ivan Kashperuk.

    public void findMenuItemUserPath()

    {

       MenuFunction mf = new MenuFunction(element.args().menuItemName(), element.args().menuItemType());

       str          menuLabel;

       boolean iterateMenus(SysDictMenu _menu)

       {

           SysMenuEnumerator menuEnum = _menu.getEnumerator();

           SysDictMenu subMenu;

           boolean found;

           while (menuEnum.moveNext())

           {

               subMenu = menuEnum.current();

               if (subMenu.isMenu() || subMenu.isMenuReference())

               {

                   found = iterateMenus(subMenu);

                   if (found) // If found, just climb back up the stack

                   {

                       menuLabel = strFmt('%1/%2', subMenu.label(), menuLabel);

                       return found;

                   }

               }

               else if (subMenu.isMenuItem() && subMenu.isValid() && subMenu.isVisible() && subMenu.menuItem().name() == mf.name() && subMenu.menuItem().type() == mf.type())

               {

                   menuLabel = subMenu.label();

                   return true;

               }

           }

           return false;

       }

       if (iterateMenus(SysDictMenu::newMainMenu()))

       {

           info(strfmt('%1/%2', strUpr(curext()), menuLabel));

       }

       else

       {

           warning('Not found in the Main Menu');

       }

    }

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

#2
Henrik Nordlöf Profile Picture

Henrik Nordlöf 2 User Group Leader

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans