Hi,
I have been trying to set some default value for cascading field based on another cascading field, I think I can able to set the value but could not able set the none - none value when others value has been set.
This article helps me to get cascading field value and This library helps me to set value for cascading field.
Ex:
User selects
Cascading 1 -> A1 - AA1
Behavior sets
Cascading 2 -> X1 - XX1
When users change the value of Cascading 1 other than A1 - AA1, the cascading 2 still shows X1 - XX1, I wanted to set it to none - none for Cascading 2.
My script looks like
def selectListField = getFieldById(fieldChanged)
def selectListValue = selectListField.value
if (selectListValue.size() > 1 && (selectListValue[1] == "Framework & Tools" || selectListValue[1] == "Operational Efficiency" || selectListValue[1] == "Strategic Tech")) {
field.setFormValue([parentOption.optionId, childOption.optionId])
}
if (selectListValue.size() > 1 && selectListValue[1] == "Internal Integration") {
field.setFormValue([parentOption1.optionId, childOption1.optionId])
}
if (selectListValue.size() > 1 && selectListValue[1] == "Reduce Cost of Implementations") {
field.setFormValue([parentOption1.optionId, childOption2.optionId])
}
else{
field.setFormValue([null, null])
}
Regards
T
Hi @Teja,
I tested below codes and both works fine for me to reset values for cascade field
cf.setFormValue([null, null])
cf.setFormValue([-1, -1])
Regards,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Teja, I've tested below code. it clears the value of cascade 2 when cascade 1 parent value changes
def ct = getFieldByName("Cascade One")
def ctval = ct.value as List
if(ctval.size() < 2 && ctval[0] != "alpha"){
getFieldByName("Cascade Two").setFormValue([null, null])
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.