Can we have a behavior script to make the user 'select only one value' in the Multi-select field?
Hi Kiranped,
Yes, you can. The multi-select field will return an ArrayList of Strings when you call the getValue method on its FormField.
Then, you can check the size of the array:
def multiSelect = getFieldById(getFieldChanged())def multiSelectValue = multiSelect.getValue() as ArrayListif (multiSelectValue.size() > 1) { multiSelect.setError("Please select only 1 value")} else { multiSelect.clearError()}
Hope this helps
It looks like you're new here. Sign in or register to get started.