Home > Ax Technical > Finding if a node is existing in lower layers Dynamics Ax

Finding if a node is existing in lower layers Dynamics Ax

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

    return highestLayer;
}

[tweetmeme source=”casperkamal” http://www.url.com only_single=false]

Advertisements
  1. July 28, 2010 at 9:25 am

    you right patrick..that is why i named it highest layer below the current layer….
    So if you are checking it from BUS and if the component is existing in SYS SYP then the code returns SYP that is why i call it highest below the current layer.

  2. Patrick
    July 28, 2010 at 8:36 am

    nice code snippet, but it retrieves the ‘lowestBelowLayer’, not the ‘hightesBelowLayer’ (asuming the lowest is the SYS-Layer), right? 🙂

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: