I'm trying to restrict a transition when three conditions are true at the same time:
I wrote the following script which is always stopping the transition. It is not allowing the transition to occur when #3 above has a value. For context, I'm using a post function to apply a value of 'Yes' to the field "Parts Ordered" once the sub-task has been closed.
if (cfValues['Order Parts']?.getValue() == 'Yes' & (cfValues['Disposition']?.getValue() == 'Rework at OEM & labor $ OEM - (FB)' | cfValues['Disposition']?.getValue() == 'Rework at OEM - (FR)') & cfValues['Parts Ordered'] == null){
return false
}
You are not returning a value of true if the conditional check fails. Try
if (cfValues['Order Parts']?.getValue() == 'Yes' & (cfValues['Disposition']?.getValue() == 'Rework at OEM & labor $ OEM - (FB)' | cfValues['Disposition']?.getValue() == 'Rework at OEM - (FR)') & cfValues['Parts Ordered'] == null){
return false
}
return true
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Try like this:
if (cfValues['Order Parts']?.getValue() == 'Yes' && (cfValues['Disposition']?.getValue() == 'Rework at OEM & labor $ OEM - (FB)' || cfValues['Disposition']?.getValue() == 'Rework at OEM - (FR)') && cfValues['Parts Ordered'] == null){
return false
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alexey,
I tried your code and it still wasn't working as expected. I am getting a validator error even when the field "Parts Ordered" has a value of 'Yes'.
Also, I see that your recommended code only changed & to && and | to || but that seems like incorrect login to me. If I understand correctly, by using a double & or double | you are using login that says STOP checking the login as soon as you get to an operator that meets the condition. But I need ALL 3 conditions to be true for the validator to kick in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.