
Hi,
Can anyone suggest a way to prevent plugin tasks being rolled back when throwing an exception. My plugin fires on create of record for entity A. Within the plugin I create another record for a different entity (entity B). I want the plugin to prevent the actual creation of record for entity A. When I throw an exception, everything rolls back including the creation of record from entity B. I have tried Pre-Validation and Pre-Create stages and it happens for both.
Any advice greatly appreciated
*This post is locked for comments
I have the same question (0)pre-validation should work in that case as pre-validation operation does not enter DB transaction so there is no question of rollback of entity B creation. May be you are missing something in the code , try to debug and see your code is executing correctly . You can add trace log and enable tracing as well.