Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

WorkflowScheduler undefined, maybe missing global qualifier

nshabestari
Kilo Contributor

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

1 ACCEPTED SOLUTION

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.


View solution in original post

12 REPLIES 12

Seems to have worked after adding the if/else and re-creating the Workflow Schedule.



Will modifying Global records have an impact on scoped app certification?


I don't think it's good idea to modify Global records from Application scope. Update would not be captured in Application scope update set/ team development.


justincarrera
Kilo Contributor

is there a patch that will fix this ?