Thank you for your feedback.
Form temporarily unavailable. Please try again or contact docfeedback@servicenow.com to submit your comments.
Versions
  • London
  • Kingston
  • Jakarta
  • Istanbul
  • Helsinki
  • Geneva
  • Store
Close

Abort a database action in a before business-rule

Abort a database action in a before business-rule

In a before business rule script, you can cancel or abort the current database action using the setAbortAction() method.

For example, if the before business rule is executed during an insert action, and you have a condition in the script that calls current.setAbortAction(true), the new record stored in current is not created in the database. The business rule continues to run after calling setAbortAction() and all subsequent business rules will execute normally. Calling this method only prevents the database action from occurring.

You can use the isActionAborted() method to determine if the current database action (insert, update, delete) is going to be aborted. isActionAborted() is initialized for new threads and the next() method explicitly sets its value to false.

Note: setAbortAction() can only be executed from the same scope as the record whose action is being aborted. current.setAbortAction is not honored if executed in a business rule that is defined in a different scope.

Updates to site content will be made starting around 4am on January 17th (Pacific Time) and lasting approximately 6 hours.  This site may be intermittently unavailable.