Custom server-side code registered in the Dataverse event pipeline that runs when data operations occur, used in Dynamics 365 for transactional validation and calculations.
A Dataverse plug-in is a custom event handler that responds to a specific event during the processing of a data operation in Microsoft Dataverse. It is written as a class in a .NET Framework assembly, and that assembly is then registered in Dataverse. One assembly can hold several classes, each registered to a different step of the event framework. In Dynamics 365, plug-ins are used for server-side logic such as transactional validation and calculations that must run when data is created, updated or otherwise processed.
Each plug-in class implements the IPlugin interface, which defines a single Execute method. When the registered event occurs, Dataverse calls that method and passes context data about the operation being processed. From there, the code can cancel the running pipeline operation, change the business data being processed, call further data operations, contact external systems, or pass information on to later plug-ins in the same pipeline. Plug-ins can run synchronously, in which case the operation waits for them to finish, or asynchronously after the operation completes.
The choice between these modes matters in practice. Logic that has to prevent bad data from being saved belongs in the synchronous part of the pipeline, while work that can happen after the save can run asynchronously. Microsoft Learn notes that synchronous plug-ins need to run quickly, and that execution is subject to a hard time limit. Poorly written code can also hurt performance, and building plug-ins requires developer skills, so they carry a cost that declarative options do not.
Because of these drawbacks, the Microsoft documentation advises checking declarative options first. Alternatives it lists include custom actions, calculated and rollup columns, webhooks and Power Automate. A plug-in becomes the appropriate tool when those options do not cover the requirement, for example when logic must be enforced inside the transaction itself.
The M365.FM episode "Customize Dataverse for Complex Business Apps" places the Dataverse plug-in inside a decision matrix for business rules. According to the episode, the questions run roughly as follows: if a rule must block bad data, use synchronous server logic; if it can run after the save, use asynchronous server logic; for cross-app messaging or approvals, use Flow or Teams; and for heavy compute or complex joins, use a Dataverse plug-in or a Dataflow. The episode also recommends keeping a rule catalog that records the table, trigger, condition, action and owner of each rule, and advises using calculated and rollup fields for deterministic math and sums over related records instead of reaching for code.
The episode "Why Power Platform Is Your Real Automation Layer — Not Custom Code" looks at the same topic from the customization-history angle. It describes the traditional Dynamics model, in which every difference between the standard application and the business process becomes another customization: a Dataverse plug-in, JavaScript attached to a form, a custom workflow activity, a scheduled job or another integration service. The episode says that each feature may work correctly on its own, but the complete process gradually becomes distributed across assemblies, scripts, workflows, APIs, configuration values and specialist knowledge. As a result, the process owner understands the policy but cannot inspect how it is implemented. This is the main argument for treating plug-ins as a deliberate choice rather than a default response to every process change.
Overview compiled with AI from M365.FM episodes and the facts on this page. You can improve it with the edit button below.
Artificial intelligence is fundamentally changing how developers build solutions on Microsoft Power Platform. In this episode of M365.FM, Mirko Peters is joined by Reza Niroomand to explore how AI-powered development is transforming the developer experience…
In this episode of the M365.FM Podcast, we explore why mastering Dataverse business skills is becoming one of the most important capabilities for organizations building scalable solutions on Microsoft Power Platform. The discussion goes far beyond tables and…
Timeline of episodes about Dataverse plug-in
Frequently asked questions
Questions marked with AI were written with AI from the facts on this page.
What is a Dataverse plug-in? (AI)
A Dataverse plug-in is a custom event handler, written as a class in a .NET Framework assembly and registered in Dataverse, that runs in response to a specific event during a data operation. Each class implements the IPlugin interface with a single Execute method.
Can a Dataverse plug-in run synchronously and asynchronously? (AI)
Yes. Plug-ins can run synchronously, so the operation waits for them, or asynchronously after the operation completes. Microsoft Learn notes that synchronous plug-ins need to run quickly and that there is a hard time limit on execution.
When should a Dataverse plug-in be used instead of other options? (AI)
Microsoft Learn advises checking declarative options first, such as custom actions, calculated and rollup columns, webhooks and Power Automate. The episode "Customize Dataverse for Complex Business Apps" suggests a plug-in or Dataflow for heavy compute or complex joins.
Short info above, community knowledge below: add practical tips, examples or corrections. New contributions are reviewed first; trusted members publish directly.
Experts and companies for this topic
Nobody has listed this topic yet. Add it to your profile.