How to clear the info Message after Submit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 03:32 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 04:15 PM
I tried the following and it worked successfully. Thanks for the direction.
if (isLoading || newValue == '') {
g_form.hideAllFieldMsgs();
return;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 04:16 PM
I tried the following and it worked successfully. Thanks for the direction.
if (isLoading || newValue == '') {
g_form.hideAllFieldMsgs();
return;
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2019 04:09 PM
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