How to clear the info Message after Submit.

Sandeep135
Kilo Contributor

We have onChange Client Script  that adds an info message when a incident moves to State is On Hold and On Hold Reason is Pending Client Action.

 We trying clear that info Message after the save or update. Our Current Approach is an onSubmit Client Script using clearMessages  but this not achieving  the desired effect. We tried onLoad Client Script instead but no effect.

 

Please find the attachments of the scripts.

7 REPLIES 7

I tried the following and it worked successfully. Thanks for the direction.

 

if (isLoading || newValue == '') {
       g_form.hideAllFieldMsgs();
      return;
   }

Sandeep135
Kilo Contributor

I tried the following and it worked successfully. Thanks for the direction.

 

if (isLoading || newValue == '') {
       g_form.hideAllFieldMsgs();
      return;
   }

The SN Nerd
Giga Sage
Giga Sage

If the above approaches don't work, you could try the following:

New Business Rule
Ater Update
State change to On Hold and On Hold Reason changes to Pending Client Action.

Code:

gs.flushMessages();



https://developer.servicenow.com/app.do#!/api_doc?v=london&id=r_GS-flushMessages

 

 


ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022