Get Privileges from AOT Tree - D365 - AX 2012

Get Privileges from AOT Tree X++ / D365

Song Nghia - Technical Consultant

class 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();
        }
    }
}
Previous Post
Next Post

post written by: