web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Prevent rollback of tasks when throwing exception in plugin

(0) ShareShare
ReportReport
Posted on by 190

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)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    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.

    https://www.inogic.com/blog/2017/03/plugin-pre-validation-operation-to-show-an-error-message-as-well-as-log-the-error/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans