Initiates a workflow on-demand. This method is the programmatic equivalent of the Initiate Workflow Action action in SuiteFlow.Returns the internal ID of the workflow instance used to track the workflow against the record.
workflow.trigger(options)
number
Server scripts
Triggers a workflow on a record. The actions and transitions of the workflow are evaluated for the record in the workflow instance, based on the current state for the workflow instance.Returns the internal ID of the workflow instance used to track the workflow against the record.
Method Description
Initiates a workflow on-demand. This method is the programmatic equivalent of the Initiate Workflow Action action in SuiteFlow.Returns the internal ID of the workflow instance used to track the workflow against the record.To asynchronously initiate a workflow, see task.WorkflowTriggerTask.
Returns
number
Supported Script Types
Server scriptsFor more information,
Governance
20 units
Parameter
Type
Required / Optional
Description
options.defaultValues
Object
optional
The object that contains key/value pairs to set default values on fields specific to the workflow.These can include fields on the Workflow Definition Page or workflow and state Workflow Custom Fields.
options.recordId
string | number
required
The internal ID of the base record.
options.recordType
string
required
The record type ID of the workflow base record. Use values from the record.Type enum. This is the Record Type field on the Workflow Definition Page.
options.workflowId
string | number
required
The internal ID (number) or script ID (string) for the workflow definition. This is the ID field on the Workflow Definition Page.