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

Thanks, Donnie,

The global.AbstractAjaxProcessor was what I was missing.  I am working in the HR Service Portal application was pulling my hair out to why my client script was not working haha

p_bansal
Kilo Contributor

Hi Donnie,



Thanks much that worked for qualifier issue



any clue on 'conversion error', query is still returning null.



Thanks



Pankaj


Try this for your script include:



var ES_sA = Class.create();


ES_sA.prototype = Object.extendsObject(global.AbstractAjaxProcessor, {



helloWorld: function() {


  var name = this.getParameter('sysparm_user_name').toString();


  return "Hello " + name + "!";


  }



});



And in your client script, un-comment this line:



//ga.addParam('sysparm_name','helloWorld');


p_bansal
Kilo Contributor

Great! it worked. Thanks much i wrap toString was missing, i believe this change is very specific to Istanbul, documentation need to be updated


Sumit Maniktala
Kilo Expert

Do you really want to use constructor? If not can you try renaming the function 'initialize' to something else & then adding a line as below



ga.addParam('sysparm_name','<function_name>'); below   var ga = new GlideAjax('ES_sA');



Also make sure last line of your script include is as below i.e. a closing curly bracket & semi colon



};