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

Notifications

Announcements

No record found.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans