- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2018 10:34 PM
I have a List choice UI action which on selecting will open a glide dialog window asking for confirmation to send a mail to the selected list entries.. This I have achieved by calling a script include in the UI Action. The script include queries the table and sends the mail. For me the window appears. On confirmation the mail is also sent. But the message in gs.addInfoMessage is not displayed anywhere. Where am I going wrong? Can anyone please help ? I am in serviceNow London version.
var comSentAJAX = Class.create();
comSentAJAX.prototype = Object.extendsObject(AbstractAjaxProcessor, {
ajaxcom: function() {
var id = this.getParameter("sysparm_id");
var gr = new GlideRecord('alm_asset');
gr.addQuery('sys_id','IN', id);
gr.query();
while(gr.next())
{
gs.eventQueue('comp.sent',gr, gs.getUserID(), gs.getUserName());
gs.addInfoMessage("Emails sent");
}
},
type: 'comSentAJAX'
});
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2018 07:16 AM
Hi Muktha,
I think as you are reloading the window once you get the ajax response that is the only reason why you are not able to see the info message on your list view. because if you reload the window the info or error message will disappear.
var Close = function() {
reloadWindow(window);
};
ga.getXMLAnswer(Close.bind(this));
return true;
};
please try not to reload window once you receive the ajax response.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2018 10:39 PM
have this statement gs.addInfoMessage("Emails sent"); in UI Action script outside of script include.
Thanks,
Ali
Thank you,
Ali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-08-2018 10:40 PM
Hi Muktha,
that message will only appear if you add that in UI action code and won't work in script include.
if you want to show that message have it in ui action script after calling script include function.
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-09-2018 02:02 AM
Hi Ankur,
Thanks for your reply. But I am unable to get that message displayed by using gs.addInfoMessage when I put it in UI Action. Below is my List choice UI action. I even tried g_form.addInfoMessage but not getting it. Please guide me where I need to add it here.
function conasset() {
var en = g_list.getChecked().split(",");
if (!en || en.length == 0)
return;
var back = function() {
var ga = new GlideAjax('comSentAJAX');
ga.addParam('sysparm_name', 'ajaxcom');
ga.addParam('sysparm_id', en.join(','));
var Close = function() {
reloadWindow(window);
};
ga.getXMLAnswer(Close.bind(this));
return true;
};
var dialogClass = window.GlideModal ? GlideModal : GlideDialogWindow;
var dialog = new dialogClass('glide_confirm_standard');
dialog.setTitle(new GwtMessage().getMessage('Confirmation'));
dialog.setPreference('warning', true);
dialog.setPreference('title', " Send mail?");
dialog.setPreference('onPromptComplete', back.bind(this));
dialog.render();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2023 02:30 PM
gs.addinfomesaage and gs.adderrormessage belongs to glisesystem API which is server side API
how we are using it for UI actions or client scripts or UI Policies
I'm a rookie RN, please lemme know