SuiteFlow Trigger Execution Model

When a record enters a state in a workflow, the workflow runs actions and transitions in this 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. If applicable, transitions for the trigger on which the record entered the state are evaluated and executed.

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

The table below shows the general order of trigger execution for actions and transitions, depending on what the user does and which trigger brought the record into 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

If applicable, actions set to a client trigger execute.

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 their 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.

But 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 don't execute. For more information, see Initiating or Entry Trigger Rules.

Initiating or Entry Trigger Rules

To understand the SuiteFlow trigger execution model, you need to know which trigger initiates the workflow and which trigger brings a record into a state:

Workflow Trigger Execution Example

Let’s say you create a workflow to make a sales order field required, validate its value, and then send an email to the user’s supervisor after saving. You set the workflow to execute when a sales order is created and to trigger on Before Record Load.

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

General Notices