Hi all I am trying to set an error if certain values are selected in a multi select field AND a specific value is selected for another custom field.
I have this working in a behavior mapped to the first custom field. However, when the value of the second field is updated the error still appears. I cannot capture the field changed for the second field alongside the first.
Any suggestions for how I can capture both values?
heres an example of what i'm trying to do
// get field1 - field selected in behavior
def fieldChanged = getFieldById(getFieldChanged())
def selectedOption = fieldChanged.value
// get field1 values into a list
def chosenValuesList = []
if (selectedOption in String) {
chosenValuesList.add(selectedOption)
} else if (selectedOption in ArrayList) {
chosenValuesList.addAll(selectedOption)
}
def field2 = getFieldByName("field2")def field2Value = field2.getValue() as Integer
if (selectedOption && field2Value == 1 && field2Value < chosenValuesList.size()){
selectedOption.setError(lessError)
}
else{
selectedOption.clearError()
}