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 10:56 AM
I am not able to see even this alert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 11:03 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-30-2023 02:10 AM
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 11:34 AM - edited 11-29-2023 11:39 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-29-2023 11:49 AM
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