mardi 28 février 2012

How to get the top most layer of an AOT object?


The X++ job below shows the top most layer of an AOT object (in this example it is the Address table).
static void se_topLayer(Args _args)
{
#AOT
int i;
str strAOTObjectPath = #TablesPath + '\\' + tablestr(Address);
TreeNode treeNode = TreeNode::findNode(strAOTObjectPath);
UtilEntryLevel topLayer;
;
for (i = 0; i <= 0xf; i++)
{
if (bitTest(treeNode.applObjectLayerMask(), 1 << i))
{
topLayer = max(topLayer, i);
}
}
print topLayer;
pause;
}

Aucun commentaire:

Enregistrer un commentaire