AbstractAjaxProcessor undefined, maybe missing global qualifier error

p_bansal
Kilo Contributor

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

10 REPLIES 10

dinesh91n
Tera Expert

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


p_bansal
Kilo Contributor

Thanks Dinesh,



Still getting return 'null' and AbstractAjaxProcessor undefined, maybe missing global qualifier error       error



Please advice.



Thanks


Pankaj


p_bansal
Kilo Contributor

This is what is logged in system log



ajax log.jpgajaxerror2.jpg


donnie5
Mega Expert

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.