GlideRecord#getValue not allowed in scoped application script-include

Rajesh152
ServiceNow Employee
ServiceNow Employee

I have one scoped application where I have written some code in a script-include like below:

var gr = new GlideRecord('my_table');
gr.getValue('some_column');

I'm getting error like: JavaException: com.glide.script.fencing.MethodNotAllowedException: Function getValue is not allowed in scope xxxxxxx

What could be the workaround can anyone please help. Also, can anyone tell me WHY getValue isn't allowed in scoped application although it is mentioned in the scoped application doc(https://developer.servicenow.com/app.do#!/api_doc?v=newyork&id=r_ScopedGlideRecordGetValue_String)

Thanks.

3 REPLIES 3

Prateek kumar
Mega Sage

Is your script include accessible from all scopes??

find_real_file.png


Please mark my response as correct and helpful if it helped solved your question.
-Thanks

It has "This application scope only"

Make it All application scopes.


Please mark my response as correct and helpful if it helped solved your question.
-Thanks