gs.addErrormessage is popping on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 05:35 AM
Hi All,
In the advance script of BR I have added
gs.addErrorMessage('xyz.');
current.setAbortAction(true);
current.state = previous.state;
The above message is just flashing on the form and disappears. I want to make the message to be visible to the user. how can I do?
Thanks,
Sowmya.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 05:44 AM
Sowmya,
Check if any of the BRs on that table has the following line of code. If so, then you need to remove that. Or, change the order of execution of that BR and your BR.
gs.flushMessages();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2016 05:58 AM
Hi Bala,
There are no flushmessages in relate to that table
Thanks,
Sowmya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2021 08:03 PM
@sowmyaj,
Did you fix the issue? I know it's been 5years ago but I am now running into the same issue.
Could you please share the solution
Thanks.
Bachtiar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2021 08:15 PM
What table?
I've only seen this being an issue when flushMessages() is called somewhere.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 08:05 PM
Hi Paul,
I am using gs.addErrorMessage() in Business Rule - Advanced script on a custom table.
When to run: before Update
Basically, to prevent the user from making an unwanted update on the form.
I can see the Error Message appears briefly as the form loads, but after the form finished loading, the Error Message disappears.
snippet of my code:
if (groupType.indexOf("77fce8bd71792900002bd97eb7bba44c") == -1 && busSvcTower == "2eed7838dbdef6007921d211ce961932") {
gs.addErrorMessage("This Ticket is currently in HR Tower and you are trying to transfer this ticket to GT Tower's Assignment Group. Please change the Business Service and the Assignment Group accordingly.");
current.setAbortAction(true);
//gs.log("Bachtiar HR BR line 37");
}
current.setAbortAction(true);
-----------------------------------
To clear up your suspicion, I don't see flushMessages() being used currenty in any active BRs.
Thanks.
Bachtiar