"Access to Script Include--- blocked from scope---" error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2022 07:06 AM
//Script Include
var GetCourseDetails_6 = Class.create();
GetCourseDetails_6.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
getCourse:function(server_side_data) {
var cc;
var courseID = this.getParameter('sysparam_course'); // getting value from client side
gs.info("jhcourse" + courseID);
var cn = new GlideRecord('x_opepo_courseware_course'); //Gliding to Course table to get Course Code
cn.addEncodedQuery('sys_id='+courseID); //matching condition table record sys_id with client_side
cn.query();
if (cn.next()) {
cc=cn.getValue('course_name');
}
return cc;
},
type: 'GetCourseDetails_6'
});
//Client Scripts
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if ( newValue === '') {
return;
}
var ga = new GlideAjax('x_opepo_servicehub.getCourseDetails');
ga.addParam('sysparam_name', 'getCourse');
ga.addParam('sysparam_course_code', g_form.getValue('course_code'));
ga.getXML(callback);
function callback(response)
{
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.setValue('name_of_course',answer);
}
}
I've created client script and script include in a scoped application named "Servicehub". Also,I've made the script include accessible from All application scopes.On changing the value of the field "Course Code",I'm getting the error :-
Access to Script Include x_opepo_servicehub.getCourseDetails blocked from scope: x_opepo_servicehub
Please tell me how to fix this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2022 09:32 AM
Thank you for the response.Since,I'm in the learning stage now,I've no idea about creating cross scope privilages.Can you brief me the exact steps?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2022 08:04 AM
You can move the script include back into scope; now with the correct spelling it should call correctly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-20-2022 06:17 AM
Hello,
Sorry, it was assumed at a minimum that your script include was set to be accessible from other scopes. Please check your script include settings.
Regardless of that, it would not have worked if you didn't correct the typo you had.
I hope my reply above was at least Helpful.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2022 07:51 AM
Hey,
You will need to create cross scope privilege for this script include
Refer to below link:
Feel free to mark correct, If I answered your query.
Will be helpful for future visitors looking for similar questions 🙂
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-17-2022 09:32 AM
Thank you for the response.Since,I'm in the learning stage now,I've no idea about creating cross scope privilages.Can you brief me the exact steps?