I tried to trigger a workflow programatically,
nlapiTriggerWorkflow(recType, recId, workflowId, actionId, stateId)
But I am getting,
"nlapiTriggerWorkflow" is not defined
both in console and in script debugger. Why do I get this error?
I tried to trigger a workflow programatically,
nlapiTriggerWorkflow(recType, recId, workflowId, actionId, stateId)
But I am getting,
"nlapiTriggerWorkflow" is not defined
both in console and in script debugger. Why do I get this error?
The issue is that nlapiTriggerWorkflow
is server side only. If you want to trigger a workflow client side you can add a button to the preceding work flow step (see the docs) and trigger your workflow from that.
Maybe this is happening because you are trying to use Suitescript 1.0 API in Suitescript 2.0
If you are using Suitescript 2.0 (or if it is feasible to switch to Suitescript 2.0), you can try this -
var workflowInstanceId = workflow.trigger({
recordType: 'salesorder',
recordId: 1234,
workflowId: 'custworkflow_name',
defaultValues: p
actionId: workflowaction25
});
In case of issues, just search for workflow.trigger(options)
in the SuiteAnswers.
Let me know.