Code to get all object of project node using MSD axapta

Code to get all object of project node using axapta


 static void listAllObjectosFromProject(Args _args)  
 {  
   ProjName        projName = "ListProjectNode_ABC";  
   ProjectListNode   list = infolog.projectRootNode().AOTfindChild("Shared");  
   TreeNodeIterator  ir = list.AOTiterator();  
   ProjectNode      pnProj;  
   ProjectNode      pn = list.AOTfindChild(projName);  
   void searchAllObj(projectNode rootNode)  
   {  
     #TreeNodeSysNodeType  
     TreeNode          childNode;  
     TreeNodeIterator      rootNodeIterator;  
     ;  
     if (rootNode)  
     {  
       rootNodeIterator = rootNode.AOTiterator();  
       childNode = rootNodeIterator.next();  
       while (childnode)  
       {  
         if (childNode.AOTgetNodeType() == #NT_PROJECT_GROUP)  
           searchAllObj(childNode);  
         else  
           info(strfmt("Grupo:%1 - Objeto: %2", rootNode.AOTname(), childNode.AOTname()));  
         childNode = rootNodeIterator.next();  
       }  
     }  
   }  
   ;  
   if (pn)  
   {  
     info(strFmt("Projet %1:", projName));  
     pnProj = pn.loadForInspection();  
     searchAllObj(pnProj);  
     pnproj.treeNodeRelease();  
   }  
   else  
     info("Projet objects");  
 }