- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2017 04:48 AM
I have created a business rule on CMDB table to restrict the user from creating a duplicate CI with Insert and stay.
var ciname=current.name;
var gr=new GlideRecord('cmdb_ci');
gr.addQuery('name',ciname);
gr.query();
while(gr.next())
{
gs.addErrorMessage('Record already present');
current.setAbortAction(true);
}
Instead of current.setAbortAction(true);, I have tried return false. It was throwing the error 'Record already present' as expected, but the record was created.
Why return(false) didn't restrict the CI creation, or what is the basic difference between current.setAbortAction(true); and return false?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2017 04:53 AM
Hi Sanker,
Return false does just that, - it returns false. It doesn't prevent additional business rules from running.
current.setAbortAction(true); stops the business rule and stops the system from continuing to run additional (higher order) business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 07:04 AM
Never mind. I found the answer. In my subsequent BR if have:
if (!current.isActionAborted()) {...}
and that did the trick!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2021 12:14 PM
OK, but what if there are 100 business rules already sitting out there in the system?
Say I'm adding business rule 101 at order 0... I detect a condition that should absolutely HALT all subsequent processing. Do I now need to go edit the existing 100 business rules and add a condition to check for isActionAborted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2017 04:53 AM
hi Sanker,
Purpose is pretty much the same, return false is mostly used in client side to cancel/stop the transaction and Abort Action on server side for the same.