List of classes

Hi,

can you tell me how to get list of classes (All the AOT objects) using X++ code, say writting a code in Job and listing all the classes. I want to get all the classes and its ids same for other objects too.

Thanx,

Ambanna Yatnal

//http://dennistech.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&_c=BlogPart&partqs=cat%3DMicrosoft%2520Dynamics%2520AX

static void GetClassList(Args _args)
{
#AOT
TreeNode treeNode;
TreeNode childNode;
int counter=1;
Boolean foundObject;
;
treeNode = TreeNode::findNode(#ClassesPath);
if (treeNode)
{
info(strfmt(‘Number of classes: %1’,treeNode.AOTchildNodeCount()));
childNode = treeNode.AOTfirstChild();
while(counter <= treeNode.AOTchildNodeCount())
{
if(childNode.AOTObjectNode())
{
info('Class Name: ’ + childNode.treeNodeName() + '; Class Path: ’ + childNode.treeNodePath());
}
childNode = childNode.AOTnextSibling();
counter++;
}
foundObject = true;
}
}

Thank you amin, please can you tell me for other AOT objects also.

static void findClassIdNames(Args _args)
{
Dictionary dictionary;
ClassId ClassId;
TableId tableId;
ClassName className;
;
dictionary = new Dictionary();
ClassId = dictionary.classNext(0);
className = dictionary.className(ClassId);

while (ClassId)
{
info(strfmt("%1 - %2",int2str(ClassId), className));
ClassId = dictionary.classNext(ClassId);
className = dictionary.className(ClassId);
}
}

use distionary class for finding tables, classes, EDT, enum, security keys etc id and names.

static void findClassIdNames(Args _args)
{
Dictionary dictionary;
ClassId ClassId;
TableId tableId;
ClassName className;
;
dictionary = new Dictionary();
ClassId = dictionary.classNext(0);
className = dictionary.className(ClassId);

while (ClassId)
{
info(strfmt("%1 - %2",int2str(ClassId), className));
ClassId = dictionary.classNext(ClassId);
className = dictionary.className(ClassId);
}
}

use distionary class for finding tables, classes, EDT, enum, security keys etc id and names.

Thanks Kranthi…