- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 11:12 AM - edited 02-18-2024 11:17 AM
Hi,
I am trying to stop users from being able to change a field and when someone tries to change it, an error message should come up. I wrote a BR for it but I the error message was coming 2 times instead of 1. So assuming the problem was with my instances configuration, I requested a fresh instance and wrote a business rule for incident table which runs before a record is updated. Here's the script:
(function executeRule(current, previous /*null when async*/) {
if (current.contact_type != previous.contact_type) {
gs.addErrorMessage("Info not saved.");
current.setAbortAction(true);
}
})(current, previous);
I have tried adding gs.flushMessages() before throwing the error message but that solution didn't work. I am still getting the error message twice.
NOTE: This only happens if i open the incident table from filter navigator and try changing the field from list view, instead if i right click on incident and choose open in new tab and then do the same then i get only 1 error message as it should come.
Ghazali
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 12:29 PM
Thanks @Ghazali,
I remember seeing this in the past and it is a known issue. The fix is available in Vancouver Patch 6, please see the details here
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1588238
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 11:43 AM
Hi @Ghazali,
Can you please provide a screenshot of the 'When to run' tab of the Business Rule?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 12:06 PM - edited 02-18-2024 12:25 PM
@James Chun Thanks for the prompt reply, here is a screenshot of the "When to run" tab :
Ghazali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2024 12:29 PM
Thanks @Ghazali,
I remember seeing this in the past and it is a known issue. The fix is available in Vancouver Patch 6, please see the details here
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1588238
Thanks