Triggers are based on events that occur during the processing of a record in NetSuite and dictate when the workflow should perform certain tasks. NetSuite defines triggers for when a workflow should initiate, when actions should be performed, or when a record should transition to another state for the record, based on the processing of a record in NetSuite. You direct a workflow to respond to the record processing events.
Server Triggers
Server triggers occur when a record is read from or written to the NetSuite database or when a record enters or exits a state in a workflow. Server triggers are classified as either record-based, workflow-based, or time-based.
- Record-based triggers occur when something happens to the record:
- The record is going to load (Before the Record Load trigger)
- After the record loads, but before it is saved (Before Record Submit trigger)
- The record is saved (After Record Submit trigger)
- Workflow-based triggers occur when something happens to the workflow
- A state has been entered (On Entry trigger)
- A stated has been exited (On Exit trigger)
- Time-based triggers occur according to a user-defined schedule (Scheduled trigger)
Workflows evaluate and execute all actions in a state for a specific server trigger before they evaluate and execute the transitions for that trigger.
The following table describes the server triggers and the type of workflow tasks to which they apply:
| Trigger Name | Applies To | Description |
|---|---|---|
| Before Record Load | Workflow initiationActionsTransitions | Triggers when a new record is created, before it is loaded into the browser, or before an existing record loads into the browser.Actions. Execute every time a record is loaded in a state.Transitions. Execute when a user loads a record.Use this trigger, for example, when setting default values on fields for the record form, hiding fields on the record form, or locking a record. |
| Before Record Submit | Workflow initiationActionsTransitions | Occurs after a user clicks Save on a record and before NetSuite saves the record data to the database.Actions. Execute every time a user clicks Save when a record is in a state.Transitions. Execute after a user clicks Save.Use this trigger, for example, when validating record form fields or calculating field values before saving a record. |
| After Record Submit | Workflow initiationActionsTransitions | Occurs after NetSuite saves the record data to the database.Actions. Execute after a record is saved to the database when a record is in a state.Transitions. Execute after a record is saved to the database.Use this trigger, for example, when sending an email that a record has been changed or when creating dependent records. |
| Scheduled | Workflow initiationActionsTransitions | You can create a schedule for workflows to initiate, and for actions and transitions to execute. |
| Entry | ActionsTransitions | Occurs the first time that a workflow enters a state at the same time as the first server trigger*.Actions. Execute the first time a record enters a state. Workflows can enter a state multiple times.Transitions. Execute when a record enters a state.*On Entry triggers do not execute on their own. They execute at the same time as the first ordered server trigger for a state, for example, the On Entry trigger executes when the workflow enters a state simultaneously with the Before Record Load trigger. |
| Exit | Actions | Occurs when a workflow exits a state and transitions to another state. |
| ALL | Workflow initiation | For workflow initiation only. The workflow initiates on any triggering event. |
Client Triggers
Client triggers execute when a user interacts with a record form in NetSuite. You can view the client triggers used for actions for a specific workflow state under Form Event on the State subtab of the context panel.
The following table describes the client triggers:
| Trigger Name | Description |
|---|---|
| Before User Edit | Executes when the record form loads into the browser.Use this trigger, for example, to make changes to the record form in the browser before the user edits any field. |
| Before Field Edit | Executes when user tabs or clicks away from a field after entering a value.Use this trigger, for example, when validating the value of a record field. |
| After Field Edit | Executes when a user enters or changes the value of a field.Use this trigger, for example, when dynamically updating the values of other fields when a user changes the value of a specific field. |
| After Field Sourcing | Executes after a field change, after all of the child field values for the field are sourced.Use this trigger, for example, when setting field values based on other sourced values. |
| Before User Submit | Executes every time a user clicks Save when the form is in the state. The actions execute in the browser, before any data is sent to the NetSuite database and the save operation occurs.Use this trigger, for example, when validating record form field values. |