Server Triggers
The workflow execution log displays each server trigger and the associated event type and context type for the trigger. Use this information to view the order in which actions and transitions executed and their corresponding triggers. You can expand and collapse each trigger to view the actions and transitions and the associated status for the action or transition.
The log displays the executed triggers for a specific workflow instance and a specific state visit in that workflow instance. Depending on the workflow definition and the events that occur on the record, for example, viewing and saving the record, the workflow may enter the same state multiple times. Consequently, multiple entries for the same state may appear in the workflow history. The workflow history does not include any state not entered by the workflow.
For an example of a record entering a state multiple times, see Approval Workflow Example.
Client triggers do not appear in the workflow execution log.
The workflow execution log displays the server triggers in the order that the triggers run. They do not run in a fixed order. The order in which the triggers appear depends on the workflow definition and the events on the record.
The following table lists the server triggers:
Trigger |
Description |
---|---|
ONENTRY |
Record enters the state. |
ONEXIT |
Record exits the state. |
BEFORELOAD |
Before the record is loaded. |
BEFORESUBMIT |
Before the record is submitted to the database. |
AFTERSUBMIT |
After the record is saved to the database. |
SCHEDULED |
NetSuite scheduler executes the workflow based on the workflow schedule. |
Additionally, a server trigger can be record, workflow, or time based:
-
Record based. An event occurs on a record. For example, a record is loaded (BEFORELOAD) or saved (BEFORESUBMIT or AFTERSUBMIT).
-
Workflow based. An event occurs on the workflow. For example, a workflow enters a state (ONENTRY) or exits a state (ONEXIT).
-
Time based. The scheduled time for the workflow arrives (SCHEDULED).
Workflows use the following rules for the order in which the server triggers appear:
-
If a workflow moves from state A to state B, the workflow first executes the ONEXIT trigger in state A and then the ONENTRY trigger in state B.
-
If a user edits a record, the workflow executes the BEFORELOAD trigger when it loads the record. If a user then saves the record, the workflow executes the BEFORESUBMIT and AFTERSUBMIT triggers, in that order.
-
For a specific state visit, only the triggers related to that state visit display.
-
The log always starts with the ONENTRY trigger. If the record leaves the state, the last trigger in the log is always ONEXIT. ONEXIT never appears before ONENTRY.
-
The BEFORELOAD, BEFORESUBMIT, and AFTERSUBMIT triggers may not appear in a log for a state visit, because the workflow may transition to another state or the workflow may finish.