TreeNode.newObjectName Method [AX 2012]

Returns a string that contains the name of the new element.

public str newObjectName([str oldName])

Run On

Called

Parameters

oldName
Type: str
The new name of the node; optional. If no argument is passed, the new node name is determined by the child node type.

Return Value

Type: str
The string that contains the name of the new element.

If no argument is passed, the new node name is determined by the child node type. For example, if the TreeNode has forms as children, calling this method without an argument will return "Form1". If the tree node has several child node types, the method returns the string "object".

The following call to Treenode.newObjectName returns "object" because the data dictionary node has children that represent several object types.

{ 
    TreeNode t; 
    str s; 
 
    t = TreeNode::findNode("\Data dictionary"); 
    s = t.newObjectName(); 
    print s; 
    pause; 
}

Community Additions

ADD
Show: