Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, Power Apps, Power Automate, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates and new features to Dynamics 365 planned through March 2020
Release overview guides and videos Release Plan | View virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
I have a technical question,
Actually i'm working on a new D365 FO project, and i have a business needs, to list all AOT objects belong to a module.
in AX2012 there is a standard table: Utilelements that contains all AOT objects and their name, but i can't find a way how to retrieve for each D365 Module, their appropriate Menus items.
For example: i'm on AP module, and i want to get all the AOT Menu items belong to this module, in AOT they are represented as a display menu items, but i can't find a way how to get them by using a simple job.
What is the business requirement you are trying to fulfill? Is it related to getting the data on the user interface, or do you need a list for development purposes? What exactly do you mean with "a simple job"?
I need to list all Sub Menus, and display Menu items for the AP module.
Where do you need list this? Please tell if a user needs a form or you need a list from Visual Studio? The requirement is still not clear to me.
I have created a specific table, with 2 columns (Label, name), what i need exactly is to retrieve a list of all display Menu items on AP module for example.
I started by this X++ code:
var displayMenuItem = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::MenuItemDisplayNames();
info(strFmt("Menu Item display name: %1",displayMenuItem.Current));
But The result here is > all Display Menu items on D365.
What i need exactly is to get, and store all those Menu Items of AP module(Menu),
I hope the idea is clear Now :) ?
public static void main(Args _args)
RunnableClass1 c = new RunnableClass1();
set result = new set(Types::String);
var modelName = 'Application Suite';
var axMenuItemType = new Microsoft.Dynamics.AX.Metadata.MetaModel.AxMenuItemDisplay();
var t = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::MenuItemDisplayNames(); // Why Enumerator?
while ( t.moveNext() )
var tname = t.get_current();
if ( c.inModel(ModelName, tname, axMenuItemType.GetType()) )
public boolean inModel(str modelDisplayName, str objname, System.Type type)
var models = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetModelsOfMetadataArtifact(objname, type);
var modelsEnumerator = models.getEnumerator();
Microsoft.Dynamics.AX.Metadata.MetaModel.ModelInfo modelInfo = modelsEnumerator.Current;
if( ModelDisplayName == modelInfo.DisplayName )
The coding you shared, would be better readable if you use the code applet ('</>') in the rich formatting option.
You can interact with classes like SysDictMenu, SysDictMenuNode and SysDictMenuTreeNode to get your result.
The code shared by Ada is evaluating the menu items per model not a menu module.
Thanks a lot, but is there any way to get them by module ( AP, or AR..)
Yes, using the classes as I had provided in my previous reply.
According to Andre's suggestion, I can get all the display menu items in Account Payable module using following demo code.
public static void main(Args _args)
TreeNode menuItemNode = TreeNode::findNode(@"\Menus\AccountsPayable");
_menu = SysDictMenu::newTreeNode(menuItemNode);
boolean iterateMenus(SysDictMenu _cmenu)
SysMenuEnumerator menuEnum = _cmenu.getEnumerator();
subMenu = menuEnum.current();
if (subMenu.isMenu() || subMenu.isMenuReference())
print subMenu.object().treeNodePath()+" is Menu";
found = iterateMenus(subMenu);
else if (subMenu.isMenuItem()&& subMenu.menuItem().type() == MenuItemType::Display)
Thanks a lot Ada, this is what i was looking for,
but while executing, i got some menus that dont exist in D365 FO Main page,
When i checked i found a subMenu property named (IsDisplayedInContentArea), i added it on the If control line, but it's not working, the result is nothing.
else if (subMenu.isMenuItem()&& subMenu.menuItem().type() == MenuItemType::Display && subMenu.Object().AOTgetProperty("IsDisplayedInContentArea") == NoYes::Yes)
}2nd Question, is there any way to list the form names related to those MenuItems.
For example, if i have a menu item display , i retrieve the related form of it
the same for Action and output menu items
an alternate way to try
else if (subMenu.isMenuItem()&& subMenu.menuItem().type() == MenuItemType::Display && subMenu.isVisible())
Hi Ada, Thanks a lot,
I'm asking if you know please any methods to retrieve or list all Form controls, like the standard tree.
Thanks for your verification. I see you have posted another thread for this new issue.
Business Applications communities