This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
Dynamics AX 2012
|
|
|
|
|
|
|
|
|
|
This post is machine-translated. The original post in german language can be found here.
These post applies to following version:
Dynamics AX 2012
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In Dynamics AX there is no way to search about a menu items name. So i've created a job, which creates the ability to do so.
The job will search about "*debitor*" and returns all found menu items in infolog. Using doubleclick on the entry in infolog will open the form or the equivalent function.
static void findMenuItem() { str _searchStr = "*debitor*"; TreeNode treeNodeMenuNode; TreeNode treeNodeMenu; TreeNodeTraverser treeNodeTraverser; TreeNode treeNodeMenu4Path; Menu menu4Path; MenuItem menuItem; str 200 path; SysInfoAction_MenuFunction sysInfoAction_MenuFunction; container menuCon; int i; #AOT #resAppl #TreeNodeSysNodeType if(_searchStr == "") return; setPrefix("Suchergebnisse"); treeNodeMenuNode = TreeNode::findNode(#MenusPath); treeNodeTraverser = new TreeNodeTraverser(treeNodeMenuNode); while (treeNodeTraverser.next()) { treeNodeMenu = treeNodeTraverser.currentNode(); if(treeNodeMenu.treeNodeType().id() == #NT_MENUITEM) { menuItem = treeNodeMenu; if(menuItem.label() like _searchStr) { sysInfoAction_MenuFunction = SysInfoAction_MenuFunction::newMenuItem( menuItem.menuItemName(), menuItem.menuItemType()); menuCon = str2con(treeNodeMenu.treeNodePath(), "\"); path = ""; for (i=3;i { if(i==3) { treeNodeMenu4Path = TreeNode::findNode(#MenusPath + "\" +conPeek(menuCon, i)); if(treeNodeMenu4Path && treeNodeMenu4Path.treeNodeType().id() == #NT_MENU) { menu4Path = treeNodeMenu4Path; path += menu4Path.label(); } } else { path += conPeek(menuCon, i); } path += " > "; } info(path + menuItem.label(), "", sysInfoAction_MenuFunction); } } } }