Показать сообщение отдельно
Старый 07.10.2019, 16:48   #1  
Blog bot is offline
Blog bot
Участник
 
25,475 / 846 (79) +++++++
Регистрация: 28.10.2006
dynamicsnavax: Loop through AOT Display Menu Items #MSDyn365FO
Источник: http://dynamicsnavax.blogspot.com/20...enu-items.html
==============

I have been experimenting with getting Metadata information from the AOT from FinOps. There is some discussion on this forum post which helped me.
https://community.dynamics.com/365/f...et-aot-objects
I thought I would try to clean it up a bit to make it a bit more readable for future reference.
The X++ code below will loop through Display menu items in the AOT and print some info.
  • Menu Item Name
  • Menu Item Label
  • Model Name
public static void main (Args _args)
{
System.Type axMenuItemTypeDisplay = new Microsoft.Dynamics.AX.Metadata.MetaModel.AxMenuItemDisplay ().GetType ();
System.Collections.Specialized.StringEnumerator menuItemDisplayNames = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::MenuItemDisplayNames ();
while (menuItemDisplayNames.moveNext ())
{
str menuItemName = menuItemDisplayNames.get_current ();
//Get Model Name for the display menu item
var enum = Microsoft.Dynamics.Ax.Xpp.MetadataSupport::GetModelsOfMetadataArtifact (menuItemName, axMenuItemTypeDisplay).GetEnumerator ();
str modelName = enum.moveNext () ? enum.Current.DisplayName : '';
MenuFunction menuFunction = new MenuFunction (menuItemName, MenuItemType::Display);
info (strFmt ("menuItemName: %1, menuItemLabel: %2, modelName: %3",
menuItemName,
menuFunction.label (),
modelName
));
}
}


Источник: http://dynamicsnavax.blogspot.com/20...enu-items.html
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.