- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 09:57 PM
Hello.
I get an error with "Glide Ajax" in a scoped application. It was output as follows in the system log.
(I got this error in the service portal, but not in UI16.)
”Script: AjaxTest not found in scope: global, and HTTP Processor class not found: com.glide.processors.xml http.AjaxTest: no thrown error”
Do script includes have to be created globally even in scoped applications?
I would like to know how to avoid this error.
【Code where the error occurred】
function onCondition() {
var dData = [];
var ajax = new GlideAjax('AjaxTest');//An error occurred here
ajax.addParam('sysparm_name', 'getJson');
ajax.getXMLAnswer(function(answer) {
dData = JSON.parse(answer).array;
});
}
【Scope etc.】
Thanks.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 11:33 PM
Hi,
It seems that both your script and UI policy are in same scope "TEST_APP" which is correct. But when you called your script include using Ajax call you simply defines script include name only.
For custom calls you need to use the API namespace, replace your code as below.
var ajax = new GlideAjax('x_******AjaxTest');//API name
Note: Also check in script include accessible from "this application scope" to "All" if you have any issue.
Mark this as Helpful/Correct, if Applicable.
Regards,
Sourabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 10:46 PM
Where is your script include,and Where is your script include client script
in global or scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 10:47 PM
Hi,
so your script include is global or custom scope?
ui policy is in which scope?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2022 11:26 PM
thank you for your reply.
Script include is set to custom scope.
Added the setting such as scope to the question text.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2022 12:25 AM
Hi,
if script include and ui policy are in same scope then you can just use name of the script include
Can you share the complete script and script include configuration screenshot
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader