Modules

filter

 

Objects/Functions

module (N/workflow)

SuiteScript 2.0

workflow.initiate(options)

{workflow}.initiate({recordType: {string*},recordId: {string | number*},workflowId: {string | number*},defaultValues: {Object}})

N/workflow Module
workflow.initiate()
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: 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.initiate(options)

Example:

// Code Example 1
//Add additional code
//...
var workflowInstanceId = workflow.initiate({
recordType: 'customer',
recordId: 24,
workflowId: 'customworkflow_myWorkFlow'
});
//...
//Add additional code

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