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

Vishwa Pandya19
Mega Sage

Hello,

 

There should be a record on the Cross Scope Privilege table (sys_scope_privilege) which specifies the source scope, target scope, operation should be execute API and target should be the script include.
Make sure the status is set to allowed.

 

If my answer has helped you in any way please mark it as correct or helpful.

Thank you for your reply. I created a cross scope privilege record, set the source scope to my scoped application, and target to the script include and operation to execute API, target scope to Global, Status to Allowed. But I still got the same error. 

dgarad
Giga Sage

Hi @ShuRiseUp2023 

please check the below steps

1) as an admin visit script include from left navigation

2) please search with the name as "script include name".

3) please change the accessible field as "All Application scopes".

If my answer finds you well, helpful, and related to the question asked. Please mark it as correct and helpful.

Thanks
dgarad

Thank you for your reply. I have already set accessible from  as "All Application scopes":. But it's not working.