In one of my previous posts, I have shared an idea of how a new Dynamics 365 SCM and Finance API can be used to get metadata of Dynamics 365 AOT elements.
Learning a path to a menu item from a user interface perspective could come in handy.
So I have created the method that I would like to share:
boolean iterateMenus(SysDictMenu _menu)
while (menuEnum.moveNext())
if (found) // If found, just climb back up the stack
return found;
if (subMenu.isMenuItem()
return true;
return false;
If (iterateMenus(SysDictMenu::newMainMenu()))
return ret;
}
You can find a couple of examples of using the method presented above, below :
1. info(strFmt('%1', Class::getMenuItemPath('SalesTableListPage')));
It will
return the result: Accounts
receivable/Orders/All sales orders
2. info(strFmt('%1', Class::getMenuItemPath(menuItemDisplayStr(InventLocations))));
It will return the result: Inventory management/Setup/Inventory breakdown/Warehouses
No comments:
Post a Comment