Monday, 2 January 2012

Ax Technical


static void EndNodes(Args _args)
    {

       TreeNode    objTreeNode,objTreeNode1,objTreeNode2;
       int a,i,b;
       objTreeNode = TreeNode::findNode(@"\Menus\AccountsReceivable\Reports");
       a = objTreeNode.AOTchildNodeCount();
       if (objTreeNode)
        {
            objTreeNode = objTreeNode.AOTfirstChild();
            /*
            change objTreeNode object properties
            */info(strFmt("%1",a));
           while (objTreeNode)
            {
                for(i=1;i<=a;i++)
                {
                    b=0;
                    // info(objTreeNode.treeNodeName());
                    objTreeNode2 = objTreeNode.AOTfirstChild();
                    b = objTreeNode2.AOTchildNodeCount();
                    objTreeNode = objTreeNode.AOTnextSibling();
                    while (objTreeNode2)
                    {
                        if(b>0)
                        {
                            objTreeNode1 = objTreeNode2.AOTfirstChild();
                            while(objTreeNode1)
                            {
                                info(objTreeNode1.treeNodeName());
                                objTreeNode1 = objTreeNode1.AOTnextSibling();
                            }
                        }
                        else
                        {
                            info(objTreeNode2.treeNodeName());
                        }
                        objTreeNode2 = objTreeNode2.AOTnextSibling();
                }
            }

        }
    }
  }

No comments:

Post a Comment