-
Notifications
You must be signed in to change notification settings - Fork 8
Dependent Optionset Control
Andrii Butenko edited this page Mar 6, 2021
·
3 revisions
This control is the new implementation of classic task with limiting of options available in one optionset depending on the value chosen in second optionset.
- To use this control you have to download and install the latest version of AB Controls Toolkit on your CDS instance that is available in Releases.
- Prepare dependency between optionsets that has following format:
[
{
"parentOption": 108730000,
"childOptions": [108730000, 108730001, 108730002]
},
{
"parentOption": 108730001,
"childOptions": [108730003, 108730004]
},
{
"parentOption": 108730002,
"childOptions": [108730005, 108730006]
}
]- Create a webresource and store this configuration inside, copy the webresource name somewhere (in my case it was 'ab_/ParentChildDependency.js').
- Open the form that you plan to use the optionset at, add (if you haven't done that yet) both optionsets, select the dependent optionset and click "Change Properties" and choose the "Controls" tab in window that popped up:
- Click the "Add Control..." button, select "Dependent Optionset" in the list of available controls and click "Add".
- In "Control" section, choose for which types of client this control will be used.
- Property "Dependent Optionset" will be selected by default, so choose parent optionset field in "Parent Optionset" property.
- Insert the webresource name you created in step 4 into the "Configuration" property.
- Save settings of optionset configuration, save and publish the entity form.