Formula Types
| Type | Trigger | Syntax |
| SQL Formulas | Server triggers | {field_id} |
| SuiteScript Formulas | Client triggers | 'field_id' in API calls |
⚠️ Important
Mismatched formula/trigger types will be ignored and show "ERROR: Invalid expression" in logs.
SQL Formula Functions
| Function | Purpose | Example |
| LENGTH() | String length | LENGTH({phone}) > 10 |
| UPPER() / LOWER() | Change case | UPPER({name}) |
| SUBSTR() | Extract substring | SUBSTR({email}, 1, 5) |
| INSTR() | Find position | INSTR({email}, '@') |
| NVL() | Handle nulls | NVL({amount}, 0) |
| TO_CHAR() | Format number/date | TO_CHAR({amount}, '999,999') |
| TO_NUMBER() | Convert to number | TO_NUMBER({text_field}) |
| CASE WHEN | Conditional logic | CASE WHEN {status}='A' THEN 'Active' END |
| || | Concatenate | {first} || ' ' || {last} |
SQL Formula Examples
{custrecord_salary} * 1.05
{phone} || '-' || {zipcode}
SUBSTR({email}, INSTR({email}, '@') + 1)
UPPER({custrecord_code}) NOT IN ('A', 'B', 'C')
SuiteScript 1.0 Functions
| Function | Purpose |
| nlapiGetFieldValue('fieldId') | Get field value |
| nlapiSetFieldValue('fieldId', value) | Set field value |
| nlapiGetFieldText('fieldId') | Get list field display text |
| nlapiLookupField(type, id, fields) | Look up field on another record |
| nlapiGetUser() | Get current user ID |
| nlapiGetRole() | Get current role ID |
SuiteScript Formula Example
nlapiGetFieldValue('custrecord_rating_code').length < 10
📋 Note
Only SuiteScript 1.0 is supported in formula conditions. SuiteScript 2.0 requires Workflow Action Scripts.