- 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-08-2016 08:17 PM
Hi Medha,
I have few questions around your requirements. If you want to add info message to the form you could use g_form.addInfoMessage method. If it is some server side message that you would like to get and then display on form. Then what you could do is not have the gs.addInfomessage in the Server code but just get the text and send it as response.
So in your ga.getXMLAnswer(function(response){
var answer = response.responseXML.documentElement.getAttribute("answer");
g_form.addInfoMessage(answer);
});
Please let me know if that answers your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 10:25 AM
Hi Venkat,
I am on a list when I use the List choice UI action, which means g_form is not available and g_list doesnt have any API's for displaying message on the UI. Could you think of any other way of I could display?
Thanks,
Medha
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:16 AM
Hi Medha,
I am bit confused here. List Choice UI action could be on main form as well where you would have access to g_form. Can you add a screenshot of the UI from where you are using it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-11-2016 11:20 AM
Right, but my requirement is on the list and not on the form. So I open a table (tableName.list) and select multiple rows and click on an List Choice UI action. The above code I have is what happens in the UI action. In this case, how can I display a message on the UI?