David B
05/27/2021, 12:00 AMDECLARE
variables inside of a saved search formula?
Using something like DECLARE myInt integer = 1
just gives ERROR: Invalid Expression
KevinJ of Kansas
05/27/2021, 2:28 AMDavid B
05/27/2021, 2:45 AMCASE WHEN {field1}+{field2}-({field3}+{field4}) > 0 THEN NVL({field5},{field1})+{field2}-({field3}+{field4}) ELSE 0 END
I've just done it in full, but was trying to do something like:
DECLARE myInt integer = {field2}-({field3}+{field4})
CASE WHEN {field1}+myInt > 0 THEN NVL({field5},{field1})+myInt ELSE 0 END
KevinJ of Kansas
05/27/2021, 2:46 AMDavid B
05/27/2021, 2:51 AMDECLARE/*magic*/ myInt integer = {field2}-({field3}+{field4})
in it's entirety the formula's ugly, but now works ¯\_(ツ)_/¯
FWIW, the formula is to replicate the "Order Items" page's "To Order" value in a saved search… 🤦KevinJ of Kansas
05/27/2021, 2:53 AMKevinJ of Kansas
05/27/2021, 2:54 AMzvictor
06/03/2021, 4:12 PM