Get Privileges from AOT Tree X++ / D365
Song Nghia - Technical Consultantclass SCA_GetPrivileges { ////// Runs the class with the specified arguments. /// /// The specified arguments. public static void main(Args _args) { #AOT str find = "PurchReqTable"; TreeNode root = TreeNode::findNode(#SecPrivilegesPath); TreeNode current; TreeNodeTraverser trav = new TreeNodeTraverser(root,false); current = trav.next(); while (current) { if ((current.AOTgetProperty('ObjectType') == "Form") && (current.AOTgetProperty('Object') == find)) info(strFmt("Found menuitem %1",current.AOTname())); current = trav.next(); } } }