addInfoMessage on g_list

medha_singri
ServiceNow Employee
ServiceNow Employee

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

1 ACCEPTED SOLUTION

venkatiyer1
Giga Guru

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


View solution in original post

18 REPLIES 18

same issue Uncaught ReferenceError: addInfoMessage is not defined


Hi Alexander,



Is this on a form? Sorry if that is the case. please prefix g_form before addinfomessage. g_form.addInfoMessage(response, 0);


Oh no , sorry on a list


Hi Alexander,



That function is no more available on the GlideList. So I believe the good alternative would be to use a glide dialog window to show the response.


Ah i understand , might you have an example of this ?