Clear addInfoMessage after 5 seconds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 01:19 AM
Hi,
I would like to clear the info message that shows on Incidents when they are created from an Universal Request after like 5 seconds as the message actually hides action buttons in the SOW.
I have located the business rule that controls the message but I don’t understand how I can make it clear after a few seconds. Is it possible to achieve by updating the script?
Alternatively if there are other good ways to inform the users about this type of message.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 02:11 AM
Hi @magnushedlu ,
try below code.
// Display the info message
g_form.addInfoMessage('This is an info message');
// Clear the info message after 5 seconds
setTimeout(function() {
g_form.clearMessages();
}, 5000); // 5000 milliseconds = 5 seconds
Accept the solution if it helped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2024 03:53 AM
Hello @magnushedlu
It is not possible to directly hide a message from the form after 5 seconds using a server-side business rule. However, the function g_form.clearMessages() can be used to clear messages, but it works only on the client side.
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 03:52 AM
Ok, so as the business rule (server side) is controlling the addinfomessage in this case I guess that I can't just add the clearmessage to the script as it only works on client side script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2024 04:36 AM
Hello @magnushedlu
Yes, you are absolutely right!
"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"
Thank You
Juhi Poddar