AX – D365FFO – FormTreeControl – Change the display label (Text) on a FormTreeItem

In a Tree view te default label is RecId and Name. If you want to change it follow this code

...

int idx = tree.getSelection();  //Get the selected node

FormTreeItem formTreeItem = tree.getItem(idx); // get the visual node

formTreeItem.text("hello"); // change the display text from whatever, to "hello"

tree.setItem(formTreeItem); // update that node in the tree

...

Another way to modify Tree node name showing only node description instead of RecId is to use the new method of class CcFormTreeDatasource in your TreeView Form

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 )

Connecting to %s