HI,
Im trying to clear a text field based on cascading's child option (if it is none). I tried using count (List) if is it less than 2, empty it. I tried getting the empty value using (?). And even getting the string value (.contains) but to no avail.
Here's what I have
def investmentClass = getFieldById("customfield_69820")
def requestClassification = getFieldById("customfield_69311")
Map selectedOptions = requestClassification.getValue() as Map
def parentOption = selectedOptions.get(0).toString()
def childOption = selectedOptions.get(1).toString()
//def cfAValue = requestClassification.value as List ///tried to count the numbers options //if (cfAValue.size < 2) {entered
//if (!childOption){ ///tried if option is empyt/null
//if (childOption.contains("bank") || childOption.contains("Bank")) { ///checked if option has value
if (childOption == null ) {
investmentClass.setFormValue('')
} else {
investmentClass.setFormValue(childOption)
}
How can i achieve this?
The text field you are trying to clear is in a parent issue or a linked issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i got it working by using below.
if (childOption == !null) {
investmentClass.setHidden(true)
investmentClass.setFormValue(childOption)
} else {
investmentClass.setFormValue('')
investmentClass.setHidden(true)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nothing rewarding than finding the solution yourself. Glad you were able to get it done!
All the best,
Fadoua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.