- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 07:18 AM
Hi Experts,
startFlow() function does not work as expected after executing the code below from Background Script or Work Flow - Run Script.
Is there anything wrong/missing from this code?
var wf = new Workflow();
var wfId = wf.getWorkflowFromName("My Workflow");
gs.log(wfId); //---> This is getting displayed!!!
wf.startFlow(wfId, null, "My Workflow", current, 'update');
Thanks!
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 07:23 AM
Hi,
Try this
var wf = new Workflow();
var wfId = wf.getWorkflowFromName("My Workflow");
gs.log(wfId); //---> This is getting displayed!!!
wf.startFlow(wfId,current, 'update');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 07:23 AM
Hi,
Try this
var wf = new Workflow();
var wfId = wf.getWorkflowFromName("My Workflow");
gs.log(wfId); //---> This is getting displayed!!!
wf.startFlow(wfId,current, 'update');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 07:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 08:02 AM
cheers mate!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2022 07:28 AM
I see that you use "current" but you did not declare current. In a background script you have to declare everything including current.