- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-08-2016 05:03 PM
I have a glideAjax on UI action (List Choice). Lets say, addInfoMessage is added from the server-side, its gone when I referesh the list, irrespective of before or after the ajax call. If I return the message to ajax call, g_list doesnt have addInfoMessage, how could I display it. Any help is much appreciated. Below is my code snippet.
function onClickFunctionName() {
var selSysIds = g_list.getChecked();
g_list.setFilterAndRefresh("");
var ga = new GlideAjax('scriptName');
ga.addParam('sysparm_name', 'funName');
ga.addParam('sysparm_sys_id', selSysIds);
ga.addParam('sysparm_show_msg', false);
ga.getXMLAnswer(function(response){
//GlideList2.get("tableName").setFilterAndRefresh("");
});
}
Thanks,
Medha
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:48 AM
Hi Medha,
Try using the below function. It should work.
The first parameter is the message.
addFormMessage("Testing", "info", 0) // for info
addFormMessage("Testing", "error", 0) // for error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:38 AM
There is not easier way other than GlideDialogWindow.
GlideDialogWindow API Reference - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:48 AM
Hi Medha,
Try using the below function. It should work.
The first parameter is the message.
addFormMessage("Testing", "info", 0) // for info
addFormMessage("Testing", "error", 0) // for error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 12:18 PM
Thanks Venkat, that works perfect for displaying message on UI, that solves half of my problem. The other issue is, I need to refresh the g_list manually after the list choice ui action is clicked. When I do this before or after the ajax call, the info message vanishes. Any pointers how I can solve the refresh the message display?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 08:03 AM
Hello sir i am not sure why this isn't working for me
ga.getXMLAnswer(function(response){
addFormMessage(response,'info',0);
});
It saying Uncaught ReferenceError: addFormMessage is not defined any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2017 08:23 AM
Hi Alexander,
Which version of ServiceNow are you in? In helsinki, i do see the function name has been changed to _addFormMessage. You can try addInfoMessage(response, 0) instead.