Question: How can i get a list of all projects in a system?
Answer: Use the code snippet below,
static void MSTA_Utility_ExportAllProjects(Args _args)
{
#aot
#properties
#AviFiles
SysOperationProgress progressBar = new SysOperationProgress();
TreeNode _treeNode;
TreeNode projectNode;
TreeNodeIterator iterator;
int i, a;
// Initialising progress bar
progressBar.setCaption("Export To Excel in progress...");
progressBar.setAnimation(#AviTransfer);
_treeNode = infolog.projectRootNode();
_treeNode = _treeNode.AOTfirstChild();
for(i = 0; i < 2; i++)
{
iterator = _treeNode.AOTiterator();
projectNode = iterator.next();
while (projectNode)
{
progressBar.setText(strfmt("Project %1", projectNode.treeNodeName()));
if(String::beginsWith(projectNode.treeNodeName(), "MSTA"))
{
info(projectNode.treeNodeName()) ;
}
projectNode = iterator.next();
a++;
}
_treeNode = _treeNode.AOTnextSibling();
}
}
Answer: Use the code snippet below,
static void MSTA_Utility_ExportAllProjects(Args _args)
{
#aot
#properties
#AviFiles
SysOperationProgress progressBar = new SysOperationProgress();
TreeNode _treeNode;
TreeNode projectNode;
TreeNodeIterator iterator;
int i, a;
// Initialising progress bar
progressBar.setCaption("Export To Excel in progress...");
progressBar.setAnimation(#AviTransfer);
_treeNode = infolog.projectRootNode();
_treeNode = _treeNode.AOTfirstChild();
for(i = 0; i < 2; i++)
{
iterator = _treeNode.AOTiterator();
projectNode = iterator.next();
while (projectNode)
{
progressBar.setText(strfmt("Project %1", projectNode.treeNodeName()));
if(String::beginsWith(projectNode.treeNodeName(), "MSTA"))
{
info(projectNode.treeNodeName()) ;
}
projectNode = iterator.next();
a++;
}
_treeNode = _treeNode.AOTnextSibling();
}
}
Hello!
ReplyDeleteThanks for sharing this, the code snippet for getting the list of all projects will be quite useful for me, because I'm a beginner in this field and want to develop my skills and get some knowledge.
I would be fantastic if you could point me in the direction of a good platform.
ReplyDeletemgsu ba 1st year result roll number wise