The CreatorCon Call for Content is officially open! Get started here.

Scoped equivalent of GlideScriptedProgressWorker()?

The SN Nerd
Giga Sage
Giga Sage

GlideScriptedProgressWorker is not callable from a scoped script.

I have looked through the documented Scoped API and cannot find anything comparable.

Has anyone come across a workaround/equivalent?

I'm currently using a global script to call the Progress worker which runs scoped code but this is not ideal, as I cannot package it on the store.


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
5 REPLIES 5

Miriam Berg
Kilo Guru

Hi Paul,



I don't know whether you are already doing this, but you need to specify the scope when calling global scripts and scripts defined in other apps..


var switches = new global.ArrayUtil(); 
switches.contains(ary, item);

Source: Scripting in Scoped Applications - ServiceNow Wiki



Best Regards,


Miriam


Some scripts can't be called even with the global prefix.


Unfortunately this is one of those cases 😕



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Oh no. =/


Omkar Mone
Mega Sage

Hello Paul,

 

I know it's a thread from past, but were you able to use the GlideScriptedProgressWorker? I'm working on a scoped application which needs the progress worker to be used, I tried with 

var worker = new GlideScriptedHierarchicalWorker();
worker.setProgressName("***");
worker.setScriptIncludeName('***');
worker.setScriptIncludeMethod("***");
worker.putMethodArg("***",***);
worker.putMethodArg("***",***);
worker.setBackground(true);
worker.start();

 

But when I try to use the "worker" object in the above mentioned SI, I'm not able to get the reference for the worker object. 

 

Can you provide any inputs?

 

Any help is appreciated.

 

Regards

Omkar Mone