This topic contains 0 replies, has 0 voices, and was last updated by fredpope 6 years, 8 months ago.

  • Author
    Posts
  • #18019

    fredpope

    Is it possible to set the InitContext of a workflow using a SuiteScript WorkFlowTrigger Task?

    I am trying to set the context of a workflow when we trigger the workflow using a N/task WorkFlowTriggerTask in Suitescript 2.0, and asking here if it is possible.

    We wrote the script accordingly:

    var workflowTask = task.create({ taskType: task.TaskType.WORKFLOW_TRIGGER });

    and then tried to set the context of the script to execute with in “ScheduledScript”.

    We have tried :

    – workflowTask.params = {context: scheduled};

    – workflowTask.params = {context: scheduledScript};

    – workflowTask.params = {initContext: scheduledScript};

    And

    – workflowTask.initContext = ‘scheduledScript’;

    While the first three throw JS Errors in the script execution logs, the fourth does not, but still does not set the context.

    The information on this page indicates that it may be possible by setting the params on the Task object :

    https://netsuite.custhelp.com/app/an…ail/a_id/43906

    But I cannot get it to work. When we look at the workflow exectuion in the system logs, it still reports “context: null”
    This is a cached copy. Click here to see the original post.

You must be logged in to reply to this topic.