- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 06:55 AM
Hi fellow service-now developers,
I am trying to call a "Script Include" from a "Client script", but I cannot make it works.
Client script:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ga = new GlideAjax('VdlAddressUtils');
ga.addParam('sysparm_name', 'hasIdGDA');
ga.getXML(getResponse);
function getResponse(response) {
var res = response.responseXML.documentElement.getAttribute("answer");
alert(res)
}
}
Script include:
var VdlAddressUtils = Class.create();
VdlAddressUtils.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
hasIdGDA: function() {
return "1";
},
type: 'VdlAddressUtils'
});
Do you know why?
PS: My script include is accessible remotely.
PS2: My alert shows a "Null".
Edit: After the suggestion of
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 08:54 AM
Ok, got it guys.
I had a "gs.log("!!!HERE!!");" into my script include, and that causes my issue.
Thank you all!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 08:40 AM
Hi Mahesh, thanks for testing it on your side. I'm trying to figure what could be different on mine.
Have a good day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2022 08:54 AM
Ok, got it guys.
I had a "gs.log("!!!HERE!!");" into my script include, and that causes my issue.
Thank you all!