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 ArrayList
if (multiSelectValue.size() > 1) {
multiSelect.setError("Please select only 1 value")
} else {
multiSelect.clearError()
}
Hope this helps :)
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.