Workflow Triggers

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.

SuiteFlow includes two types of triggers, server triggers and client triggers:

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     

In general, the type of trigger you use in SuiteFlow depends on when you want a workflow to either initiate or complete a specific action or transition. For example, if you want to alert users that they must change a field value before they submit the record, issue an alert on a client trigger. If you want to notify users after they submit the record with a system error, issue an alert on a server trigger. You can only initiate workflows on server triggers.

Limiting the actions that a workflow performs can improve its layout. Likewise, choosing the correct type of trigger optimizes workflow execution and reduces the potential for missing information. This is especially important for workflows that execute on a client trigger, as they involve the user interacting with the interface.

You can initiate a workflow or transition to another state on any of the server triggers or set up actions to execute on the server and client triggers. The triggers supported for actions depend on the type of action. To understand the order in which triggers execute for actions or transitions in a workflow state, see the SuiteFlow Trigger Execution Model.

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.

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 initiation

  • Actions

  • Transitions

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 initiation

  • Actions

  • Transitions

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 initiation

  • Actions

  • Transitions

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 initiation

  • Actions

  • Transitions

You can create a schedule for workflows to initiate, and for actions and transitions to execute.

Entry

  • Actions

  • Transitions

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.

Note:

The Scheduled trigger is considered a server trigger. However, scheduled actions and transitions are not directly associated with user events such as loading or saving a record. Scheduled actions and transitions are automatically initiated by NetSuite, based on user-defined time increments. For more information, see Scheduled Trigger and Initiating a Workflow on a Schedule.

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.

More Information About Server and Client Triggers

Use the following table to get more information about working with server and client triggers:

Task

For more information

Understanding the SuiteFlow trigger execution model

SuiteFlow Trigger Execution Model

Get a description of each trigger type, including examples

Triggers Reference

View which triggers did or did not execute

Workflow Execution Log

Using triggers for workflow initiation

Workflow Initiation

Using triggers for actions

Action Triggers

Using triggers for transitions

Transition Triggers

Related Topics

General Notices