Microsoft Dynamics AX FAQ

Microsoft Dynamics AX FAQ

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

X++Posted by Studio Erudit team 2008-10-19 16:10

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;
}

  • Comments(2)//daxfaq.studioerudit.com/#post8