I am trying to build a workflow that uses a SetFie...
# suiteflow
h
I am trying to build a workflow that uses a SetFieldValue action with a formula to set a checkbox custom field on an invoice indicating EU reverse charge, and I don't seem to be able to use `TRUE`/`FALSE` values in my formula expression. For example this gets me an error:
You have entered an Invalid Field Value ERROR: Invalid Expression for the following field: custbody_reverse_charge
Copy code
CASE WHEN ({subsidiary.country} <> {entity.address.country}) AND
({subsidiary.country} IN ('United Kingdom', 'France')) AND ({entity.address.country} IN ('Netherlands',  'Luxembourg',  'Estonia',  'Lithuania',  'Hungary',  'Belgium',  Portugal',  'United Kingdom',  'Slovakia',  'Croatia',  'Czechia',  'Italy',  'Finland',  'Poland',  'Malta',  'Germany',  'Slovenia',  'Romania',  'Bulgaria',  'Austria',  'Sweden',  'Cyprus',  Denmark',  France',  'Ireland',  'Spain',  'Greece',  'Latvia'))
THEN TRUE
ELSE FALSE
END
I am able to work around it by using an "always checked" custom field for the
true
case, and
NULL
for the
false
one. This works:
Copy code
CASE WHEN ({subsidiary.country} <> {entity.address.country}) AND
({subsidiary.country} IN ('United Kingdom', 'France')) AND ({entity.address.country} IN ('Netherlands',  'Luxembourg',  'Estonia',  'Lithuania',  'Hungary',  'Belgium',  Portugal',  'United Kingdom',  'Slovakia',  'Croatia',  'Czechia',  'Italy',  'Finland',  'Poland',  'Malta',  'Germany',  'Slovenia',  'Romania',  'Bulgaria',  'Austria',  'Sweden',  'Cyprus',  Denmark',  France',  'Ireland',  'Spain',  'Greece',  'Latvia'))
THEN {entity.custentity_true_field}
ELSE NULL
END
Is there a better solution here? I'd love to get rid of the "always checked" field!