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)

Fill in only if you are not real





The following XHTML tags are allowed: <b>, <br/>, <em>, <i>, <strong>, <u>. CSS styles and Javascript are not permitted.
Posted by Alex 2009-09-28 16:42

@Swapna, it looks like it just does a bitwise &. This is the function itself:

static boolean bitTest(int _flags, int _test)
{
return _flags & _test;
}

Posted by Swapna 2009-07-15 09:10

What does this "bitTest"Function do?Pls explain