Didn't know where else to post this - I have a for...
# suiteql
x
Didn't know where else to post this - I have a formula (text) column on a search for Inbound Shipments -
CASE WHEN {custrecord_customcheckbox} = 'F' THEN 'Create' ELSE 'Update' END
. The checkbox in question is unchecked, but this column keeps returning 'Update' in the results.....anyone have any ideas?
s
If you add a new custom checkbox field to a record type, any records that existed before the checkbox was added will have a NULL value instead of 'F', and NetSuite treats NULL and 'F' the same. You can handle it a few ways. The easiest is to flip the logic and only look for the 'T' values, and make the 'F' / NULL case be the default:
CASE WHEN {custrecord_customcheckbox} = 'T' THEN 'Update' ELSE 'Create' END
Or, you can use OR, NVL, or COALESCE to handle both 'F' and NULL the same:
CASE WHEN NVL({custrecord_customcheckbox}, 'F') = 'F' THEN 'Create' ELSE 'Update' END
CASE WHEN {custrecord_customcheckbox} = 'F' OR {custrecord_customcheckbox} IS NULL THEN 'Create' ELSE 'Update' END
Any of those should work, but I tend to go with the first option in my own formulas.
x
@scottvonduhn I never knew that it was considered 'null' on pre-existing records.
But that seems to be working for what I need
✔️ 1
s
it makes me throw up a little to see SQL like this in NS