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.
var workflowInstanceId = workflow.trigger({
recordId: '5', // replace with an actual record id
recordType: 'salesorder',
workflowId: 'custworkflow_name',
actionId: workflowaction25
});
- options.actionId: The internal ID of a button that appears on the record in the workflow. Use this parameter to trigger the workflow as if the specified button were clicked.
- options.recordId: The record ID of the workflow base record.
- options.stateId: The internal ID (number) or script ID (string) of the workflow state that contains the action.
- options.workflowId: internal id of workflow
- options.workflowInstanceId: The internal ID of the workflow instance.