Using a Custom Formula
You can use custom formulas to create conditions for workflow initiation, actions, and transitions. You can build formulas based on the fields for the workflow base record or on joined records. The formula values are calculated dynamically when the workflow instance runs.
Custom Formula Elements
You can use the following elements in a formula:
-
Internal NetSuite field IDs. Record fields in NetSuite have an internal NetSuite ID. You can reference fields with this internal ID. For more information about working with formula fields, see Creating Formula Fields.
-
SQL functions. You can use SQL functions in a condition for workflow initiation or in a condition on a transition or action that executes on a server trigger. For more information about SQL functions, see SQL Expressions.
For example, you can use the following condition to restrict the custrecord65 field to 10 characters or less in a Return User Error action:
LENGTH({custrecord65}) > 10
. -
JavaScript/Suitescript API functions. You can only use JavaScript or SuiteScript in a condition on an action that executes on a client trigger.
You can enter formulas directly in the Formula box or you can use the Formula Builder. See Using the Formula Builder.
The following screenshot shows two actions with custom formulas for conditions, where the SQL formula occurs on a server trigger and the SuiteScript API formula occurs on a client trigger:
Using the Formula Builder
Similar to the Condition Builder, you can use the Formula Builder to create custom formulas. To use the Formula Builder, select the SQL functions or JavaScript functions and the fields, and the builder creates the formula in the Formula box. To create a formula with the Formula Builder, see Defining a Condition with Formulas.
The following screenshot shows the Formula Builder for a SQL expression: