- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 01:10 AM
Hello,
I am having issues with gr.isActionAborted(). Even though my update does NOT go through, gr.isActionAborted() returns false. Weirdly, when logging gr.update(), it returns null... I logged it like this. This code snippet is placed within an if-statement checking that grTask.isValidRecord()
grTask.update();
gs.info("grTask: " + grTask.update());
gs.info("is action aborted?" + grTask.isActionAborted());
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 01:42 AM
Hi,
see image below
1) I have 1 Before BR which blocks the update
So isActionAborted() -> gave true
I deactivated the BR and
So isActionAborted() -> gave false
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
‎10-23-2020 01:42 AM
Hi,
see image below
1) I have 1 Before BR which blocks the update
So isActionAborted() -> gave true
I deactivated the BR and
So isActionAborted() -> gave false
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
‎10-23-2020 01:49 AM
My record does not get updated however, even though gr.isActionAborted() returns false. As I mentioned gr.update() returns null, which is contradictive of gr.isActionAborted() returning false?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 01:54 AM
Hi,
Did you check why record is not getting updated?
try to add try catch block to know any exception thrown
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
‎10-23-2020 01:58 AM
Yeah,
it's due to a Data Policy that I created. I do not want my record to get updated for that scenario. My issue lies in gr.isActionAborted() returning false, even though record is NOT updated...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-23-2020 02:02 AM
Hi,
Possibly isActionAborted() this works well with any before BR which blocks the update.
but doesn't work well with data policy.
As per docs it says this methods is mainly for before business rules
Abort a database action in a before business-rule
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader