ANS-0005 · SAVED SEARCHES & FORMULAS
How to Use Field IDs in NetSuite CASE WHEN Formulas with Apostrophes
When constructing NetSuite CASE WHEN formulas, referencing internal field IDs can resolve issues with apostrophes in string comparisons.
Short answer
To correctly implement a CASE WHEN formula in NetSuite when a logical test keyword contains an apostrophe, utilize the field's internal ID instead of its display name. For instance, when dealing with account types, reference {account.type.id} to ensure proper evaluation and avoid syntax errors caused by special characters.
Scenario
Users may encounter difficulties when constructing a NetSuite CASE WHEN formula where a specific keyword within the logical test contains an apostrophe. This situation can lead to syntax errors or incorrect formula evaluation, as the apostrophe might be misinterpreted as a string delimiter, preventing the formula from parsing correctly.
Solution
To address the challenge of including a keyword with an apostrophe in a CASE WHEN formula's logical test, the recommended approach is to use the field's internal ID. For example, to correctly reference the account type within such a formula, the following internal ID should be used:
{account.type.id}Expert NetSuite Support
Need help with this NetSuite issue?
Saved Searches & Formulas consulting and configuration support
