Error message vanishes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 03:34 PM
Hello Community,
When the below code - the error message vanishes and form reloads but I want error message to stay so that user/developer knows why it is aborted. Should I just place error message at end.
gs.addErrorMessage("Unable to approve it. please contact admin");
current.setAbortAction(true);
gs.setRedirect(current);
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 03:51 PM
Hello kutti,
From the following knowledge article, there is no workaround for that issue:
The Info Message disappears too quickly while redirecting a record producer in Service Portal
Hope this helps!
Please mark my answer as correct if it solves your issue or mark it as helpful if it is relevant for you!
Best Regards,
Filipe Cruz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 04:41 PM
I am using this code in BR not in record producer.
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 06:13 PM
Hi Kutti,
It's the combination of setAbortAction(true) with setRedirect() as mentioned in the following Now Support page.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0539962
Maybe use current.setWorkflow(false) instead of current.setAbortAction(true).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-04-2022 07:57 PM
maybe try to convert the checks in client side ? that way you can put some timeout and delay redirection