- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2016 02:38 PM
Has anyone seen this issue when scheduling a workflow within a scoped application?:
WorkflowScheduler undefined, maybe missing global qualifier
My workflows and activities are all created on a scoped app. Is it possible to create a Workflow Schedule and alter the back-end call? In log I see the line failing is:
var ws = new WorkflowScheduler(); ws.run();
I do not see a way to change this call from the Workflow Schedule table, however. Pretty certain the solution would be to make the call "new global.WorkflowScheduler();", however I do not see a place to change this script from the Workflow Schedules table.
The end goal is to schedule the workflows that are in the scoped app to run every X minutes.
Regards,
Neema
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 01:02 PM
Hi Neema,
Can you please try with below script
if (current.sys_scope.getDisplayValue() == 'Global') current.script = "var ws = new WorkflowScheduler();
ws.run();";
else current.script = "var ws = new global.WorkflowScheduler();
ws.run();";
Please put few log statements and check which line is getting executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 08:01 AM
Hi Neema,
I see that you have defined the custom application in the application field. This is what i was mentioning actually. Thanks for sharing the screenshot. One thing do check is on the script include see if the accessible from is selected to be all application scopes. If that is the case and you are still getting the issue, one option would be to raise the HI ticket to see why it is not accessible. Other would be to copy this script include into your custom application and call directly instead of global.WorkflowScheduler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 08:10 AM
The script include appears to show that it is accessible from "All Application Scopes".
I will open a HI ticket to see why it is not accessible and attempt the other workaround as well.
Thanks,
Neema

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 11:51 AM
Hi Neema,
This is a known issue and the PRB number is PRB657531
Current Workaround
There is business rule called as 'Set workflow scheduler script'. Below script used as a workaround
current.script = "var ws = new global.WorkflowScheduler(); ws.run();";
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 12:14 PM
Hi Pradeep,
I have altered the Business Rule called 'Set workflow scheduler script' to use the workaround and added the global qualifier. Upon saving I re-created my Workflow Schedule and executed, but the error is the same as before. Am I still missing any steps or is this a bug in the platform? See screenshot below:
Thanks,
Neema

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-03-2016 01:02 PM
Hi Neema,
Can you please try with below script
if (current.sys_scope.getDisplayValue() == 'Global') current.script = "var ws = new WorkflowScheduler();
ws.run();";
else current.script = "var ws = new global.WorkflowScheduler();
ws.run();";
Please put few log statements and check which line is getting executed.