ANS-0052 · SAVED SEARCHES & FORMULAS
How to Correctly Use Quotation Marks in NetSuite Saved Search Formula (Text) Columns
Learn how to properly structure CASE statements with string values in NetSuite saved search formula fields to avoid syntax errors.
Short answer
To correctly use quotation marks for string literals within a formulatext column in a NetSuite saved search, enclose the entire CASE statement within a single set of double quotation marks. For example, use "CASE WHEN {item} IS NULL THEN 'expense' ELSE 'item' END" to define conditional text outputs.
Scenario
Users often encounter issues when attempting to define conditional text outputs in a NetSuite saved search using a formulatext column. Specifically, challenges arise when incorporating string literals, such as 'expense' or 'item', within a CASE statement, leading to syntax errors or unexpected results.
Solution
To successfully implement conditional text logic in a NetSuite saved search formulatext column, the entire CASE statement, including all string literals, must be enclosed within a single set of double quotation marks. This ensures that the formula is parsed correctly by NetSuite. For instance, to categorize records based on whether an item is present, the following syntax should be used:"CASE WHEN {item} IS NULL THEN 'expense' ELSE 'item' END"
Expert NetSuite Support
Need help with this NetSuite issue?
Saved Searches & Formulas consulting and configuration support
