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);

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo di WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione /  Modifica )

Google photo

Stai commentando usando il tuo account Google. Chiudi sessione /  Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione /  Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione /  Modifica )

Connessione a %s...