SuiteFlow Trigger Execution Model

When a record in a workflow enters a state, the workflow instance executes actions and transitions in the following order:

  1. Actions and transitions with an Entry trigger execute. The actions only execute the first time a record enters a state. Then the transitions execute.

  2. Actions for the trigger on which the record entered the state execute.

  3. Transitions for the trigger on which the record entered the state are evaluated and executed, if applicable.

  4. If the record transitions to another state, actions with a trigger of Exit execute before the record transitions to the next state.

The following table describes the general order of trigger execution for actions and transitions for a state in a workflow, depending on the record action when the record is in the state and the trigger on which the record entered the state.

Record Action

Trigger

Actions

Transitions*

User creates or opens a record.

Before Record Load

  1. Actions set to trigger on Entry execute the first time the record enters the state.

  2. Actions set to trigger on Before Record Load execute.

  1. Transitions set to trigger on Entry execute.

  2. Transitions set to trigger on Before Record Load execute.

Record loads into the browser.

Any client trigger

Actions set to a client trigger execute, if applicable.

None. Transitions do not execute on client triggers.

User clicks Save on the record.

Before Record Submit

Actions set to trigger on Before Record Submit execute.

Transitions set to trigger on Before Record Submit execute.

After Record Submit

Actions set to trigger on After Record Submit execute.

Transitions set to trigger on After Record Submit execute.

* Note: Transitions with no Trigger On value (blank trigger) execute as soon as the conditions are met.

For example, if the record enters the state on the Before Record Load trigger, actions set to trigger on Entry and all the subsequent triggers may execute, depending on the state layout.

However, if the record enters the state on the Before Record Submit trigger, only actions set to trigger on Entry, Before Record Submit, and After Record Submit execute. Actions and transitions for the Before Record Load trigger and any client triggers do not execute. For more information, see Initiating or Entry Trigger Rules.

Initiating or Entry Trigger Rules

Understanding the SuiteFlow trigger execution model depends on knowing the trigger on which a workflow instance initiates and the trigger on which a record enters a state:

Workflow Trigger Execution Example

You create a workflow to mark a sales order field as required, validate the field value, and then send an email to the user’s supervisor after the record is saved. You create a workflow that initiates on the creation of a sales order record and triggers on the Before Record Load server trigger.

The following table describes the states in the workflow:

State Name

Description

State 1 Entry

Contains an action and a transition. The action triggers on Entry and makes a field required on the record form. The transition triggers on Before Record Load and transitions to State 2.

State 2 Field Validation

Contains an action to validate the value of the field when the user modifies it. Contains a transition that triggers on Before Record Submit and transitions to State 3.

State 3 Send Email

Contains an action that triggers on After Record Submit and sends an email that notifies the user’s supervisor that the sales order was entered.

The workflow instance executes as follows:

  1. The workflow instance initiates when the user creates the sales order record and enters the entry state, State 1 Entry.

    The server trigger on which the record enters the state is Before Record Load.

  2. The workflow instance executes actions set to trigger on Entry and marks the field as required. Then, the workflow instance executes the Before Record Load trigger, executes the transition, and the record enters State 2 Field Validation.

  3. The server trigger on which the record enters the state is still Before Record Load.

    The workflow instance executes the client trigger when the user edits the required field and makes sure the field has the correct value. The user clicks Save and the Before Record Submit trigger executes and the record transitions to State 3 Send Email.

  4. The record enters State 3 Send Email on the last trigger that executed, Before User Submit. The workflow instance then executes the next server trigger, which is After Record Submit. The send email action executes and the workflow completes.

Rules and Guidelines for Workflow Triggers and Trigger Execution

Use the following rules and guidelines when working with workflow triggers:

Related Topics

Workflow Triggers

General Notices