Hi,
I have created a 'multi select checkboxes' custom field 5 option including 'None'.
It is a single field with multiple checkboxes as options.

I am trying to write a behaviour script for that field such way that if 'None' option is checked, then all other selected option will be unchecked by automatically. Also, 'None' will be unchecked by selecting any other option.
Here is my code,
def gatingMechanismField = getFieldById(getFieldChanged()) // Getting Gating Mechanism field object
def gatingMechanismValue = gatingMechanismField.getFormValue(); // Getting gating mechanism values
if(gatingMechanismValue == '13405' )
{
gatingMechanismField.setFormValue('13405')
}
else
{
List list = gatingMechanismValue;
if(list.contains(13405))
{
list.remove(13405);
gatingMechanismField.setFormValue(list)
}
}
It doesn't work.
Observation:
- getFormValue() return's value of the option (say: 13405) as a string when 'None' is chosen
- If we choose more than one option , it returns array list (ex: [13405, 13400. 13401])
Can someone please help me on this.