Hi,
Trying to validate two custom fields (select list and text line - multi) but can't get it to work and does not seem to validate properly. It either parses the first condition or not at all.
The goal of the validation is to display an error message if user selects 'Yes' but leaves the comment field blank/null.
I've tried different variations of this condition and switched the conditions around but to no avail.
cfValues['Select List'].value.contains('Yes') && cfValues['Text Line']?.value == null
Variations
#1
if (cfValues['Select List'].value.contains('Yes'))
{
cfValues['Text Line']?.value == null
}
#2
if (cfValues['Select List'].value.contains('Yes'))
cfValues['Text Line']?.value == null
#3
cfValues['Select List'] == 'Yes' && cfValues['Text Line'].value == null
and others.
I've also added the following before the condition to check the logs to see if the values of the custom fields are as expected and they are...
log.warn (cfValues['Select List'])
log.warn (cfValues['Text Line'])
Appreciate any help!