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 = Yes
  • CascadeSelect = No
  • Check 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 obtain tis result follow this code

FormTreeItem formTreeItemNode = ActivityTree.getItem(ActivityTree.getSelection());
formTreeItemNode.stateChecked(FormTreeCheckedState::partial);
ActivityTree.setItem(formTreeItemNode);

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