AX – D365FO – Auto collapse whole tree in FormTreeControl

If you have a Tree control on your form and want to collapse the whole tree with all items and subitems at once, you can use the following static method: SysFormTreeControl::collapseTree(FormTreeControl _formTreeControl, TreeItemIdx _treeItemIdx, int _toLevel = 0,int _level = 0 ) For example to expand the whole tree from the root item to the … Continue reading AX – D365FO – Auto collapse whole tree in FormTreeControl

AX – D365FO – Use checkbox in FormTreeControl

If you want to use checkboxes in a FormTreeControl follow these instructions. In the tree contol set these 3 properties values : AutoDeclaration = YesCascadeSelect = NoCheck Box = Yes To get this result Follow this code FormTreeItem formTreeItemNode = ActivityTree.getItem(ActivityTree.getSelection()); formTreeItemNode.stateChecked(FormTreeCheckedState::Checked); ActivityTree.setItem(formTreeItemNode); ActivityTree is the name of the FormControlTree control If you want to … Continue reading AX – D365FO – Use checkbox in FormTreeControl

AX – D365FO – Auto expand whole tree in FormTreeControl

If you have a Tree control on your form and want to expand the whole tree with all items and subitems at once, you can use the following static method: SysFormTreeControl::expandTree(FormTreeControl _formTreeControl, TreeItemIdx _treeItemIdx, int _toLevel = 0,int _level = 0 ) For example to expand the whole tree from the root item to the … Continue reading AX – D365FO – Auto expand whole tree in FormTreeControl

AX – D365FO – Create a Simple and Detail – Tree Form

This article is dedicated to my colleague Andrew Nearness This example shows how to create a "Simple and create Detail - Tree" Form This is the result we want to obtain First create Extended data types Al0VendorActivityId of type Int64 Al0VendorActivityName of type String Al0VendorActivityHierarchyId of type Int64 Then create "Al0VendorActivity" table Add these fields … Continue reading AX – D365FO – Create a Simple and Detail – Tree Form

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 … Continue reading AX – D365FFO – FormTreeControl – Change the display label (Text) on a FormTreeItem