January Problem Solver of the MonthCongratulations to Sourav Dam for be selected in our monthly random drawing, Dynamics Community Problem Solver Sweepstakes.
Read aboug Sourav | Learn how to enter
2020 release wave 1 Discover the latest updates and new features to Dynamics 365 planned through September 2020
Release overview guides and videos Release Plan | Preview 2020 Release Wave 1 Timeline
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
Greetings Dynamics gurus,
I inherited a synchronous Pre-operation server plugin on email create where I want to NOT send an email if we've already sent the user too many emails. In the case where the plugin is not supposed to send an email it needs to put a record in another entity but it is using the same service provider. In our current implementation it seems the only way to allow the save in the other entity but prevent the email from being sent is to throw an exception after logging the email attempt, this has the undesired effect of plugging up the tracelog with loads of plugin failures that are not actually failures.
My first question is how it possible that throwing the exception after logging the attempt does not cause the entire transaction including the logging of the event to roll back? Am I not in a transaction at this point? Is a separate transaction being spawned on the same service provider for the log attempt and because its on a different entity than the entity initiating the plugin that is causing it to function?
My second question is: Is there a way to accomplish what I've described about without throwing an exception but still causing the logging to occur and the email not to get sent and without an exception using an email create plugin registration?
You can avoid the roolback by using actions.
I did not understand your problem...can you please screenshot your plugin's steps and your code ?
Business Applications communities