Share via


TreeNode.findNode(String) Method

Definition

Returns a specified node in the Application Object Tree (AOT).

public:
 static Dynamics::AX::Application::TreeNode ^ findNode(System::String ^ _path);
public static Dynamics.AX.Application.TreeNode findNode (string _path);
static member findNode : string -> Dynamics.AX.Application.TreeNode
Public Shared Function findNode (_path As String) As TreeNode

Parameters

_path
String

A string that indicates the path that is used in the search.

Returns

The requested TreeNode object or nullNothingnullptrunita null reference (Nothing in Visual Basic) if no node with the specified path exists.

Remarks

Another way of getting a TreeNode object is by using the Info.getNode method. An important difference between the two methods is that the Info.getNode method will give you a node that is detached from the AOT, whereas the findNode method will return the node in the AOT. This means that the node that is returned by the Info.getNode method will not have a parent node, whereas the one returned by the findNode method will have a parent node.

The following example retrieves the name of the tree node that is found the TreeNode::findNode method is called. This example checks whether the user has the required security key before it calls the TreeNode.findNode method.

server static public void Main(Args _args) 
{ 
    TreeNode tn; 
    str name; 
    tn = TreeNode::findNode(@"\Classes"); 
    if (tn) 
    { 
        name = tn.treeNodeName(); 
    } 
}

Applies to