Scoped App - Getting error when calling a REST call in scoped app

ryadavalli
Tera Expert

There is a scheduled job which is calling a script include which inturn is calling the REST message.

Working fine when done in global scope, but I move the same code in scoped app, I am getting following error:

Cannot find function getMessage in object TypeError: Cannot find function setAuthentication in object [object RESTMessageV2]..

6 REPLIES 6

Mike Patel
Tera Sage

Can you share your scheduled job script?

var gr= new getIncident().runJob(); 

getIncident is the script include name in the scoped app and runJob is the method. 

you need something like below

var gr= new xxxxxxxx.getIncident().runJob(); 

If you go to script includes you will see api name

find_real_file.png

ryadavalli
Tera Expert

Hmm still the same error plus another error " Cannot find function getMessage in object ReferenceError: "JSUtil" is not defined.."