i am not getting any alerts on glide ajax

Community Alums
Not applicable

Hi,

Can you please let me know why my alert is not getting triggered?

 

ajax.png

 

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
   if (isLoading || newValue === '') {
      return;
   }
	alert("inside ajx");
	var get_Caller_Details = g_form.getValue("caller_id");
	var ga = new GlideAjax("multiple_Autopopulate_Class");
	ga.addParam("sysparm_name","multiple_Autopopulate_Function" );
	ga.addParam("sysparm_id", get_Caller_Details);
	ga.getXML(callBackFunction);
	function callBackFunction(response){
   var answer = response.responseXML.documentElement.getAttribute("answer"); 
   alert("response is " + response);
   alert("answer is " + answer);
	}


}

 

Script.png

 

var multiple_Autopopulate_Class = Class.create();
multiple_Autopopulate_Class.prototype = Object.extendsObject(AbstractAjaxProcessor, {

    multiple_Autopopulate_Function: function() {
        var parm = this.getParameter("sysparm_id");
        var gr = new GlideRecord("sys_user");
        gr.addQuery("sys_id", parm);
        gr.query();
        if (gr.next()) {
			return gr.email + ", " + gr.location + ", " + gr.manager;
        }

    },

    type: 'multiple_Autopopulate_Class'
});

 

Regards

Suman P.

17 REPLIES 17

Community Alums
Not applicable

I am not able to see even this alert

    alert("inside ajx");
after changing the caller. I am surprised at what is going on. Still no luck. Code looks good to me though, the code.

Hello @Community Alums 

 

While using glide ajax sometimes alert wont work, so pls check with gs.log()

 

Plz mark my solution as Accept, If you find it helpful.

 

Regards,

Samaksh

Community Alums
Not applicable

Well...using your code I am able to see the first alert() message. I am even seeing the AJAX response and following alert() messages.

Only difference I see is in the AJAX - I put it to All application scopes (but its not only this probably).

Do you have domain separation on this instance?

JoroKlifov1_0-1701338984911.png

 

JoroKlifov1_1-1701338987847.png

 

DhanujaH
Tera Contributor

Hi Dave,

 

While creating the script include it asks to select a user role for Access Control on Client Callable Script Include, hope you are having the required role?

Please accept the solution, If you find it helpful.

 

Thanks,

Dhanuja

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Community Alums ,

 

After reading all the comments I believe just try creating a new client script n check. Hope that works. Deactive the existing one.

 

Thanks,

Danish