Abort the execution in business rule and refresh the record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 12:46 AM
How to refresh the current record with values stored in the database after abort action?
gs.addErrorMessage('You are not allowed save the record.');
current.setAbortAction(true);
action.setRedirect(current);
above code is aborting the execution but not keeping the user selected data in the fields. I want to revert back to the previous data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 02:56 AM
Hi Swathi,
Unless and until you reload the record it will still show the data given by user. once you reload the record the data vanishes and actual data for fields are fetched from database.
What is your requirement here?
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-19-2018 03:01 AM
After displaying an error message, record has to be refreshed.
My requirement is if a user is a member of group A should not be allowed to edit the incident.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2018 03:04 AM
Hi Swathi,
So showing error message; reloading the form i.e. record is your requirement.
If user is member of group A should not be allowed to edit incident. Then why not have ACL for this?
That would be the best approach.
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.
Thanks
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-24-2018 04:36 AM
Hi Swathi,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
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-24-2018 06:48 AM
ACL is not a good idea, it will lock down the fields or a record. I want to display error message to the user when he changes the form and data should move back to previous state which is not happening unless I manually refresh the form.