Hi MSDAX technical consultants,
In Microsoft dynamics AX 2012 to find all the objects from the projects you can use following code.
static void listAllObjectosFromProject(Args _args)
{
#define.Shared("Shared")
ProjName projName = "Test";
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.treeNodeType().id() == #NT_PROJECT_GROUP)
{
searchAllObj(childNode);
}
else
{
//info(strfmt("Group :%1 - Object: %2", rootNode.AOTname(), childNode.AOTname()));
info(strfmt("%1", childNode.AOTname()));
}
childNode = rootNodeIterator.next();
}
}
}
;
if (pn)
{
//info(strFmt("Project %1:", projName));
pnProj = pn.loadForInspection();
searchAllObj(pnProj);
pnproj.treeNodeRelease();
}
else
{
info("Projet objects");
}
}
In Microsoft dynamics AX 2012 to find all the objects from the projects you can use following code.
static void listAllObjectosFromProject(Args _args)
{
#define.Shared("Shared")
ProjName projName = "Test";
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.treeNodeType().id() == #NT_PROJECT_GROUP)
{
searchAllObj(childNode);
}
else
{
//info(strfmt("Group :%1 - Object: %2", rootNode.AOTname(), childNode.AOTname()));
info(strfmt("%1", childNode.AOTname()));
}
childNode = rootNodeIterator.next();
}
}
}
;
if (pn)
{
//info(strFmt("Project %1:", projName));
pnProj = pn.loadForInspection();
searchAllObj(pnProj);
pnproj.treeNodeRelease();
}
else
{
info("Projet objects");
}
}