- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2025 11:45 AM
OnLoad Client Script:
function onLoad() {
var ga = new GlideAjax('global.TestingClientSide');
ga.addParam('sysparm_name', 'onLoadTest');
ga.getXMLAnswer(callbackFunc);
function callbackFunc(resp) {
alert(resp);
g_form.setValue('description', resp);
}
}
Script Include(Glide AJAX enabled):
var TestingClientSide = Class.create();
TestingClientSide.prototype = Object.extendsObject(AbstractAjaxProcessor, {
onLoadTest: function() {
return "hello";
},
type: 'TestingClientSide'
});
It is always returning null, I have tried both async, sync methods but is not working either way. Simple thing but dont know why it is not working.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2025 02:07 AM
I have debugged this, and after trying all the possible solutions I found that everything is working fine.
Just, the function name 'onLoadTest' is causing the issue, because ServiceNow thought it as some OOTB keyword.😑
I have changed the function name to onLodTest/onLoaTest/xyz/etc. all is working fine.
Thank you for all the replies and help. 😄
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2025 12:01 PM
Hi @pranavagarw,
if it is in global scope, you might not need the global prefix in calling the script include. also you combine single and double quotes. none of it might not be the culprit, but cost you nothing to try.
Have you tried to log the values?
This reply is 100 % GlideFather and 0 % AI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2025 10:47 PM
Hi @pranavagarw ,
Have you ensured correct configuration of the script include in the record itself?
If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.
Best regards
Anders
Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2025 11:27 PM
Hi @pranavagarw ,
Things to check
1. make sure client callable/GlideAjax Enabled is checked
2. if you client script is in different scope make sure the script include is accessible from all application scopes
3. also check if there is any ACL on the script include and the user has access to call the ACL
put the filter name contains your script include name operation=execute and type = client_callable_script_include
if you find any acl check if the users have relevant role to call the script include
if there are no acls 1st 2 check should fix the issue
above 3 checks should fix the issue
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2025 11:31 PM
both client script and script include are in same scope?
share screenshots for both the scripts
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
