Posts Tagged ‘layers’

Finding if a node is existing in lower layers Dynamics Ax

July 28, 2010 2 comments

Sometime when we were automating our form documentation methodology I had one particular requirement. I had to find if a component exists in the lower layer(Below BUS layer in our case). I tried searching for a way in the standard Ax to figure out. But i was unsuccessful, so at the end I wrote myself a small piece of code that will indicate if a component exists in the lower layer.

Here it goes

UtilEntryLevel getHighestBelowCurLayer(TreeNode _treeNode)
    UtilEntryLevel layer, highestLayer;

    for (layer=UtilEntryLevel::sys; layer < UtilEntryLevel::bus; layer++)
        if (SysTreeNode::isNodeInLayer(_treeNode, layer))
            highestLayer = layer;

    return highestLayer;

[tweetmeme source=”casperkamal” only_single=false]