i am not getting any alerts on glide ajax

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 10:16 AM
Hi,
Can you please let me know why my alert is not getting triggered?
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);
}
}
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 12:49 PM
@Community Alums Try converting the onChange script to an onLoad client script and check if the alerts trigger. Run this change in an incognito window, as clients scrips are cached in the browser and may result in not reflecting the latest changes if ran in a non incognito window.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 05:55 AM
Thank you all. I will recreate it in a new script and let you know. Something is definitely wrong here. Thank you for all of your help.
Regards
Suman P.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 06:26 AM
Hello @Community Alums
if my response helped you in solving your query, please mark it as Accepted.
Regards,
Samaksh