- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 12:36 AM
i tried:
gs.clearOutputMessages();
and
gs.clearMessages();
but it does not work
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 12:45 AM
Hi,
Clear/hide messages will work only on the client side.
or you can try with the flush message on the server-side.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 12:39 AM
Hi,
Business rules are executed synchronously on the server (unless async is used).
The API gs.addErrorMessage() queues a message to be displayed to the end user in their web browser/device.
Alas, adding a 5 seconds sleep will do nothing but add 5 seconds to the Business Rule execution time.
You need to add an onLoad Client Script to do this after your Business Rule returns.
You will need your condition to mimic the Business Rule conditions, otherwise, all messages will be cleared after 5 seconds.
For example, if your Business rule condition is 'State' is "In Progress" in the Incident [incident] table, your onLoad Client Script for Incident would have this code:
if (g_form.getValue('state') == 2) { // IN PROGRESS
setTimeout(g_form.clearMessages, 5000); // 5 SECONDS
}
https://www.w3schools.com/jsref/met_win_settimeout.asp
Regards,
Vaishnavi Lathkar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 12:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 12:46 AM
those messages are generated from BR or some client side script?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-26-2021 01:21 AM
BR too, sometimes this BR i running 3-4 Times at the same time, and i want to prevent the 4 Messages appears for the User.
to describe with more details:
it is a ServerSide ui Action.
if you select 5 Approvals (checkbox on the Leftside) an Select a List Action. The Action runs for every selected Record.
So only after the last Check the Message should stay on the form.