current.setAbortAction(true); in After Business Rule

Vineetha Rohra1
Giga Guru

I have written an After Business Rule in a scoped application.

I am evaluating certain conditions in it after which i am deciding if the record should get inserted or not.

Even when i use current.setAbortAction(true); the record still gets inserted in the table because it is 'after-insert or update' business rule.

I have some peculiar requirements because of which i cannot use before BR.

Any help would be appreciated.

7 REPLIES 7

Kalaiarasan Pus
Giga Sage

It doesn't make sense to abort an action in a after business rule and it won't work either.


Deepak Kumar5
Kilo Sage

Hello,



After BR is used for update related record based on current update.


Let me know what you are validating after saving the current record.


Agree with the people before me. An after BR cannot be used to abort a transaction as the transaction has already happened.



Probably you will need to split your BR in a before (validating and aborting if needed) and an after to do whatever else you had to do.



Bear in mind though, the after BR should not need to update the current record as this could lead to a circular update calling itself again. Be careful with this.


Could you please refer to this question of mine.



Business Rule doubt



My current question has arised from above article.