05.11.2020, 10:11 | #1 |
Участник
|
dynamicsaxinsight: Get path for menu item in X++
Источник: https://dynamicsaxinsight.wordpress....u-item-in-xpp/
============== Purpose: This post describes how we can get the full menu path of a given menu item. Product: Dynamics AX 2012 Code: static void MAKMenuItemPath(Args _args) { #TreeNodeSysNodeType #Properties #AOT TreeNode menuItemNode = TreeNode::findNode(@"\Menu Items\Display\HRMParameters"); TreeNode menuNode; xRefPaths xRefPaths; xRefReferences xRefReferences; TreeNode parentNode; str path; xRefPaths = xRefPaths::find(menuItemNode.treeNodePath()); while select xRefReferences where xRefReferences.referencePathRecId == xRefPaths.RecId && xRefReferences.Reference == XRefReference::Read { path = SysLabel::labelId2String(menuItemNode.AOTgetProperty(#PropertyLabel)); menuNode = TreeNode::findNode(xRefPaths::findRecId(xRefReferences.xRefPathRecId).Path); if(menuNode && SysTreeNode::path2ApplObjectType(menuNode.treeNodePath()) == UtilElementType::Menu) { parentNode = menuNode.AOTparent(); while(parentNode && parentNode.treeNodePath() != #MenusPath) { path = SysLabel::labelId2String(parentNode.AOTgetProperty(#PropertyLabel)) + " > " + path; parentNode = parentNode.AOTparent(); } info(path); } } } Источник: https://dynamicsaxinsight.wordpress....u-item-in-xpp/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. |
|
|
|