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, ...
Unanswered

How to get the list of menu with their path

(0) ShareShare
ReportReport
Posted on by

Hi guys,

I was wondering is there a standard report to get a list of D365 menu, along with their path like (for example : Account Receivables > Customers > All Customers)

Thanks,

I have the same question (0)
  • Blue Wang Profile Picture
    on at

    Hi VoltesDev,

    No such report, but you can use New metadata API to get all menu list.

    dev.goshoom.net/.../

    Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetMenu(menuStr(MainMenu));
  • VoltesDev Profile Picture
    on at

    Hi Blue,

    Thanks, but comes to mind, how the Functional (non-developer) can get this then ?

    As this is actually more concern for example for assigning security, or for documentation, or user guide.

    Just can't believe there is no other way, except have to do some coding just for this.

    Thanks,

  • Blue Wang Profile Picture
    on at

    HI VoltesDev ,

    Please try this: Task recordings ,But for many menuitems, it seems inconvenient to work.

    dynamicspedia.com/.../

  • VoltesDev Profile Picture
    on at

    Hi Blue,

    Yes, it is definitely do inconvenient.

    Task recorder is good for User guide, but that is my example only. What we really need is list of all menu including customised.

    Thanks

  • VoltesDev Profile Picture
    on at

    Hi Blue,

    Found this interesting topic, on the last discussion, it look correct,

    community.dynamics.com/.../1084310

    But it is says it is limit by 6, and I tried to remark it, looks good but I do still need the path.

    The code, while is great, only show menu name (label), so no hierarchy.

    Thanks,

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

    I see you're discussing the same topic in two threads in parallel, which complicates things a lot. Anyway, you'll find my answers in the other thread.

  • VoltesDev Profile Picture
    on at

    Hi Martin,

    Yes, because at first I haven;t found it. But then also because that thread is verified already so I consider it is closed case already.

    that's why I put the link it the end.

    Thanks,

  • alexmeyer.itguy Profile Picture
    648 on at

    VoltesDev,

    I'm assuming you meant that you want to get a D365 menu item along with their path. There is not a standard report for this but you can get this via code, the code I use to obtain this data is in .NET but can easily be converted to X if needed:

            public static ArrayList GetMenuMetadata()
            {
                List menuList = new List();
                this.searchMenuSubNodes(menuList, TreeNode.findNode(@"\Menus"));
                return new ArrayList(menuList);
    
            }
    
            public void searchMenuSubNodes(List menuList, TreeNode _treeNode)
            {
                if (_treeNode == null)
                    return;
    
                _treeNode = _treeNode.AOTfirstChild();
                while (_treeNode != null)
                {
                    if(_treeNode.AOTfirstChild() != null)
                        this.searchMenuSubNodes(menuList, _treeNode);
    
                    if(_treeNode.treeNodeType() != null)
                    {
                        MenuMetadata menu = new MenuMetadata();
                        menu.Path = _treeNode.treeNodePath().Replace("\\Menus\\", "");
                        menu.Label = _treeNode.treeNodeName();
                        TreeNodeType type = _treeNode.treeNodeType();
                        switch (type.id())
                        {
                            //Menu Items
                            case 307:
                                menu.Name = (string)_treeNode.AOTgetProperty("MenuItemName");
                                string menuItemType = (string)_treeNode.AOTgetProperty("MenuItemType");
                                if(menuItemType == "Display")
                                {
                                    menu.Type = ((int)Microsoft.Dynamics.AX.Metadata.Core.MetaModel.SecurableType.MenuItemDisplay).ToString();
                                }
                                else if(menuItemType == "Output")
                                {
                                    menu.Type = ((int)Microsoft.Dynamics.AX.Metadata.Core.MetaModel.SecurableType.MenuItemOutput).ToString();
                                }
                                else if(menuItemType == "Action")
                                {
                                    menu.Type = ((int)Microsoft.Dynamics.AX.Metadata.Core.MetaModel.SecurableType.MenuItemAction).ToString();
                                }
                                menuList.Add(menu);
                                break;
                            //Tile
                            case 332:
                                menu.Type = "Tile";
                                menu.Name = _treeNode.AOTname();
                                menuList.Add(menu);
                                break;
                            default:
                                break;
                        }
                    }
                    _treeNode = _treeNode.AOTnextSibling();
                }
            }
            
        public class MenuMetadata
        {
            public string Path { get; set; }
            public string Name { get; set; }
            public string Label { get; set; }
            public string Type { get; set; }
        }

    It will allow you to get data like the report below:

    menu_5F00_path.png

  • ArunGarg Profile Picture
    3,926 on at

    HI Alex,

    As I can see I need the same type of form for getting all the Menu items with labels and path.

    Do we have any function or class shown above to get the data like report .

    Best Regards

    Arun Garg

  • alexmeyer.itguy Profile Picture
    648 on at

    Arun,

    The report above is generated from an external solution I am a lead developer on (Fastpath Assure) that generates this report by calling a custom service operation endpoint that utilizes the code I provided to create the report. If you wanted to do this in D365FO you could store this data in a physical or temp table and use that as a data source for a form grid.

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
Abhilash Warrier Profile Picture

Abhilash Warrier 669 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

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

#3
Martin Dráb Profile Picture

Martin Dráb 423 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans