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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archive)
Unanswered

Effect of Errors in Pre-Execution/Post Stage on Updates Made in Pre-Validation Stage in Dynamics CRM Plugins

(0) ShareShare
ReportReport
Posted on by 11

Hi,

In Dynamics CRM, if updates are made in the pre-validation stage of a plugin, and an error occurs in the pre-execution or post stage of another plugin registered for the same event, what will be the effect on the updates made in the pre-validation stage? Will the updates be rolled back automatically or stored in memory and not yet committed to the database? 

Im not getting it correctly from the documention for the bold text "Stages 20 and 40 are guaranteed to be part of the database transaction while stage 10 may be part of the transaction."
https://learn.microsoft.com/en-us/previous-versions/dynamicscrm-2016/developers-guide/gg327941(v=crm.8)?redirectedfrom=MSDN#:~:text=organization%27s%20execution%20pipeline.-,Inclusion%20in%20database%20transactions,-Plug%2Dins%20may

Or if someone can give examples scenerios where we are in transaction for the pre-validation and when we not.


For reference, got this post while I was searching this scenerio, I've not tried it myself.

I'm looking for clarification, Thank you in advance for your expertise!

  • CU07070338-0 Profile Picture
    2 on at

    Understanding how errors in the Pre-Operation or Post-Operation stages affect updates made in the Pre-Validation stage Sprunki is critical for plugin development. Below is a concise explanation based on the Dynamics 365 event execution pipeline.

  • Feminho Diniz Profile Picture
    65 on at
    RE: Effect of Errors in Pre-Execution/Post Stage on Updates Made in Pre-Validation Stage in Dynamics CRM Plugins

    Hi Muhammad. About my post:

    I really don't know why it was rolling back. Honestly, it's still a mystery to me. I don't know why it was solved by changing the steps of the execution of the plugin but it worked... maybe the team was created but not associated with any record at the end? really don't know. Still, it was the only strange case I had with plugin steps in 8 years of Dynamics CRM. Usually, it runs like that:

    1) Pre-Validation plugins are out of any transaction so they will never roll back the operation. For example, if you create an Account and a Pre-Validations plugin goes on error, the Account will still be there

    2) Any error in any Sync plugin on Pre or Post Update will rollback the entire chain as they are part of the same transaction

    3) Async plugins that go on error will also rollback but they have individual transactions so it will be rolled back without affecting other plugins (community.dynamics.com/.../657077)

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

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard > 🔒Ι Microsoft Dynamics CRM (Archived)

Featured topics

Product updates

Dynamics 365 release plans