Modules

filter

 

Objects/Functions

module (N/workflow)

SuiteScript 2.0

workflow.trigger(options)

{workflow}.trigger({recordType: {string*},workflowId: {string | number*},workflowInstanceId: {string | number},actionId: {string | number},stateId: {string | number}})

N/workflow Module
workflow.trigger()
Method Description: 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.
Returns: number
Supported Script Types: All server scripts For more information, see SuiteScript 2.0 Script Types
Governance: 20 units
Module: N/workflow Module
Since: 2015.2
Search NetSuite - https://system.netsuite.com/app/help/helpcenter.nl?search=workflow.trigger(options)

Example:

// Code Example 1
//Add additional code
//...
var workflowInstanceId = workflow.trigger({
recordType: 'salesorder',
workflowId: 'custworkflow_name',
actionId: workflowaction25
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_4344892270.html