The CreatorCon Call for Content is officially open! Get started here.

How to clear Info / Error messages in Service Portal

PabloL
Tera Contributor

Hello SNOW community,

 

I have an issue where messages that I display in a custom widget using spUtil.addInfoMessage() sometimes don't clear out automatically, but sometimes they do.

 

I'm looking for a way to force the messages that I displayed to go away after a couple of seconds.

2 REPLIES 2

SK Chand Basha
Tera Sage
Tera Sage

Hi @PabloL 

 

Refer this KB : https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1211106

 

Mark it Helpful and Accept Solution!! If this helps you to understand.

 

 

So I did try to use server side gs.addInfoMessage() combined with gs.flushMessages(), but I'm missing on how to wait a couple of seconds before clearing the messages, because setTimeout was not available from a Service Portal Widget's server script