Hello, does anyone know if it is possible to use n...
# general
s
Hello, does anyone know if it is possible to use nested conditions in workflow transitions? For example: CASE WHEN condition1 is true THEN use conditionA ELSE CASE WHEN condition2 is true THEN use conditionB END The transition should only happen if conditionA or conditionB is true. Is this possible?
v
This should be possible, something like: CASE WHEN (conition1 = n AND condition2 = y) THEN CONDITION A WHEN (conition2 = x AND condition2 = z) THEN CONDITION B ELSE 'unknown' END I think you can even use a nested CASE if you wanted to
Or just use two different transitions, one for each condition.
s
Yes but it seems that you can't use CASE WHEN for transitions. No matter how simple I make it I always get false and an ERROR: Invalid Expression in the log
but indeed I haven't tried the 2 different transitions yet, might be simpler
v
Ah, I understand what you mean. I think if you just have the condition evaluate to true without using the CASE WHEN it will work. I did something like: TRUNC({today}) - TRUNC({trandate}) < 46 AND UPPER(NVL({custbody_cdi_internal_so_notes},'null')) NOT LIKE '%RUSH%' AND nvl({shipmethod},'null') <> 'Inside Delivery' And assuming those conditions are all true it will set a particular field value. I imagine it would work the same for a transition
I have another longer one with nested AND/OR conditions and it seems to be working as well
s
I see, it does indeed work without CASE WHEN, but just by using AND/OR but the problem is that I have a field {subtotal} that only exists in 1 out of 2 cases so for the case it doesn't exist, the condition returns an error instead of just false
v
I'm not quite sure I understand what you're trying to do. Can't make any promises but if you explain it a little more maybe I can help.
Why doesn't the {subtotal} field exist in both conditions?
s
It has to with VAT: it doesn't exist in the USA but does outside. So for subsidiaries inside USA I can only use the field {total} while for those outside USA, I have to use {subtotal} to exclude the VAT in the approval
But it does work now with the 2 transitions (1 for each condition)c
Thanks for the help!
v
np, good luck!