Solved: Access to Script Include blocked from scoped application

ShuRiseUp2023
Tera Expert

Hello everyone.

I'm trying to access a script include from a scoped application catalog item client script. The client script use GlideAjax call server-side script include to return office location based on user. I passed user sysId to the script include. But I got error message: Access to Script Include XXXXX blocked from scope application x_123455_xxxxxx.  The Script include is global and check Client callable, accessible from All application scopes. 

ShuRiseUp2023_0-1715667050111.png

 

I tried to call other global script include and got the same error message. 

Anyone know what's going on. I used other scoped application to call the same script include and no such error. It seems like this scoped application has some property need to be set correctly. 

Thank you in advance.

2 ACCEPTED SOLUTIONS

swathisarang98
Giga Sage
Giga Sage

Hi @ShuRiseUp2023 ,

 

Could you please share the client script which you have written ?

 

and also while GlideAjax try adding script include api name which will be something like below,

swathisarang98_0-1715700630598.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

View solution in original post

ShuRiseUp2023
Tera Expert

Thank you everyone for your help. I have solved this problem. Just add a global. before the script include. 

var ga = new GlideAjax('global.getLocation'); // getLocation is the script include class

Do we always have to add a "global." in front of the script include when calling in the Client Script? 

View solution in original post

10 REPLIES 10

swathisarang98
Giga Sage
Giga Sage

Hi @ShuRiseUp2023 ,

 

Could you please share the client script which you have written ?

 

and also while GlideAjax try adding script include api name which will be something like below,

swathisarang98_0-1715700630598.png

 

Please mark this comment as Correct Answer/Helpful if it helped you.

Regards,

Swathi Sarang

 

Thank you for your answer. I figured it out on my own before I saw you post!  Yes. I just added a global. in my client script and it works. As I understanding when other scripts call this script include they need to use the API Name instead of Name, right? If other script in the same scope call it is the global is still needed? 

@ShuRiseUp2023 if the scope is same then no need to use api name just script include name will work.

 

Regards,

Swathi Sarang

ShuRiseUp2023
Tera Expert

Thank you everyone for your help. I have solved this problem. Just add a global. before the script include. 

var ga = new GlideAjax('global.getLocation'); // getLocation is the script include class

Do we always have to add a "global." in front of the script include when calling in the Client Script? 

 

Where exactly should I add this line: var ga = new GlideAjax('global.getLocation')? I'm still getting the same issue.