Discussions
NSC | Fixing Inline HTML Fields That Incorrectly Return “Empty” for Populated Fields
Scenario
A NetSuite administrator created an Inline HTML custom field intended to highlight a populated body field using HTML styling.
Example formula:
CASE
WHEN TRIM(NVL({custbody5}, '')) != ''
THEN '<div style="background-color:yellow; color:black; font-weight:bold;">'
|| {custbody5} ||
'</div>'
ELSE 'Empty'
END
However, even though {custbody5} contained data, the formula continued returning 'Empty' instead of the highlighted value.
Solution
Option 1: Use LENGTH() to Check for Values
In this formula, replacing the TRIM(NVL()) logic with a simpler LENGTH() check resolved the issue.
CASE
WHEN LENGTH({custbody5}) > 0
THEN '<div style="background-color:yellow; color:black; font-weight:bold;">'
Learn how to Refer A Member | Earn the Answer Accepter Badge | Be the Content Creator of the Quarter | Vote for the content you want to see!
