AbstractAjaxProcessor undefined, maybe missing global qualifier error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 09:13 PM
Hi,
I am trying to query server for some required information and following product documentation but no luck facing lots of errors and need some expert insight, since it might be product release issue in Istanbul
script include
var ES_sA = Class.create();
ES_sA.prototype = Object.extendsObject(AbstractAjaxProcessor, {
initialize: function() {
var name = this.getParameter('sysparm_user_name').toString();
return "Hello " + name + "!";
},
client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ga = new GlideAjax('ES_sA');
//ga.addParam('sysparm_name','helloWorld');
ga.addParam('sysparm_user_name',"Bob");
//ga.getXMLWait();
//alert(ga.getAnswer());
ga.getXML(HelloWorldParse);
function HelloWorldParse(response) {
var answer = response.responseXML.documentElement.getAttribute("answer");
alert(answer);
}
alert is returning null and error AbstractAjaxProcessor undefined, maybe missing global qualifier error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-09-2017 09:22 PM
Hi Pankaj,
you need to call the function initialize() from the client side, please add the line ga.addParam('sysparm_name','initialize'); below var ga = new GlideAjax('ES_sA'); and run the code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2017 06:03 PM
Thanks Dinesh,
Still getting return 'null' and AbstractAjaxProcessor undefined, maybe missing global qualifier error error
Please advice.
Thanks
Pankaj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2017 06:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-10-2017 08:44 PM
Hi, Pankaj:
Try qualifying the reference to AbstractAjaxProcessor with 'global' in your script include:
ES_sA.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {
I don't remember why, but I know in some contexts that's required. I believe even some out-of-box scripts qualify it that way. When it is required and you don't have the 'global' qualifier, you'll get the error you're seeing.