Hide/Remove Info/Error Messages

priya119
Kilo Explorer

Hi All,

We are unable to find a clear/hide Message in gs. as it is there for a Field Message i.e. g_form.hideFieldMsg

We are adding Info and Error messages on display of a problem record using 'gs.addInfoMessage()' in a BR

Wiki site referred :
1) To add a Display rule : http://wiki.service-now.com/index.php?title=Business_Rules#Display_Business_Rules
2) to display info/error message :
http://wiki.service-now.com/index.php?title=GlideSystem#addInfoMessage.28Object.29

At times the number of messages appearing on the form duplicates. Usually when we hover on the record icon in the listing and then click the link to go to the record (which executes the display BR twice).

Does anyone know of any method to clear info/error message before adding it ? Or suggest an alternative for the same (preferably server side)


Thanks
Saumya

2 REPLIES 2

CapaJC
ServiceNow Employee
ServiceNow Employee

gs.flushMessages() will flush ALL messages, but you don't want to do that. What if there are other messages the user needs to see?

You could not do the addInfoMessage for popups, and that should address this specific issue you're running into.

if (!RP.isPopup())
gs.addInfoMessage("I like tacos");


Thanks that was helpful.

I have been experiencing this issue even when I open multiple records in different tabs. Not sure if popup is the issue in these cases. Also the messages sometime appear on nonproblem records as well (These messages are written on the display BR for a Problem.)