Initiating a Workflow on an Event
To initiate a workflow instance on an event, select Event Based under Initiation on the workflow definition page and then select one or both of the following events for the workflow base record type:
-
On Create. Initiate an instance of the workflow when the record is created.
-
On Update. Initiate an instance of the workflow when the record is viewed or updated.
You must also select the server trigger type for workflow initiation. See Workflow Initiation Triggers.
The following table describes optional requirements that you can use to further define when a workflow instance initiates:
|
Option |
Description |
|---|---|
|
Event Types |
User interface activity used to create, view, or update the record. The trigger type determines which event types are available. See Workflow Event Types. |
|
Contexts |
NetSuite functionality or feature used to create, view, or update the record. See Execution Contexts and Workflows. |
|
Condition |
Use the Condition Builder or Formula Builder to define requirements that must be met for a workflow instance to initiate. See Workflow Conditions. |
|
Saved Search |
Initiate the workflow if the record for the workflow meets the criteria in the saved search. The saved search must run on the same record type as the base record type for the workflow. The saved search must also include at least one filter set on the Criteria subtab for the saved search. |
For example, you can create a lead nurturing workflow to run when a record is created and saved. Select On Create for the event-based initiation and select the After Record Submit trigger. You can also create a condition so the workflow instance only runs on lead records with customer category of Individual.
The following screenshot shows the lead nurturing workflow:
Workflow Initiation Triggers
For a workflow to initiate on a create or update event on a record, you must also set the initiation trigger type in the Trigger Type dropdown list.
The following table describes when the workflow initiates for each trigger type:
|
Trigger Type |
Description |
|---|---|
|
- All - |
The workflow initiates for any triggering event. For example, the workflow initiates when a record is viewed because the Before Record Load trigger executes when the record is viewed. Best practice is to choose a more specific trigger type for workflow initiation because the workflow initiates for any action on the record with this trigger. |
|
Before Record Load |
The workflow initiates and the record goes into the entry state when you load a record by clicking New or Edit, or when you view the record. |
|
Before Record Submit |
The workflow initiates and the record goes into the entry state after you click Save on the record and before NetSuite writes the record data to the database. |
|
After Record Submit |
The workflow initiates and the record goes into the entry state after the NetSuite writes the record data to the database. |
Choosing the Correct Initiation Trigger
Use the trigger that best matches the purpose of your workflow.
-
Before Record Load - modify the record form or user interface.
-
Before Record Submit - validate or update data before the record is saved.
-
After Record Submit - perform business processing after the record has been committed to the database, such as creating related records, sending notifications, or initiating downstream processing.
For more information, see Server Triggers and SuiteFlow Trigger Execution Model.
Best Practice for Initiating Workflows on Record Load
If your workflow performs business processing, such as approval routing, creating records, or executing custom actions, avoid using Before Record Load as the workflow initiation trigger unless the workflow is intended to start every time a record is viewed.
Records can be loaded multiple times during normal user interaction. If multiple load events occur in quick succession, multiple workflow instances may be initiated. Consider using Before Record Submit, After Record Submit, or programmatic workflow initiation when only one workflow instance should process a record.