CRM Crate

What are plugins in Microsoft Dynamics CRM?

We will learn what are Plugins in Microsoft Dynamics 365 CRM. In CRM, we can perform various levels of operations and actions which are necessary to support the organizational requirement. There are many ways to execute these operations or business logic including out-of-the-box business rules, workflows, actions, custom workflow, plugins etc. Among these. the plugins are one of the most used and a powerful method to perform any operation within the application.

what is a plugin

What exactly are the Plugins?

A plugin is custom and configurable business logic or custom business code that you can integrate with the Microsoft Dynamics 365 CRM. The main motive of plugin code is to enhance the standard features provided by Microsoft CRM and to accomplish complex operations and logic which cannot get executed with out-of-the-box processes. The plugins acts an an event handlers which are registered as assemblies within the CRM and are triggered or executed on certain dedicated events such as create, update or delete.

Where are the plugins written and compiled in?

Plugins are written and compiled in Visual Studio by creating a class library project within .NET framework. The plugins are compiled in form of .dll assemblies and are loaded in the CRM uniquely for each entity.

On what conditions can we trigger the plugin?

The plugins are triggered on basis of allocated messages. The messages are nothing but the events which can occur in the CRM records. Below are the different types of out-of-the-box messages, events or conditions on which we can triggered the plugin.

Message NameMessage DescriptionOwnership Type
CreateWhen a record is created in CRM.User-owned entities only
UpdateWhen a record is updated in CRM.User-owned and organization-owned entities
DeleteWhen a record is deleted in CRM.User-owned and organization-owned entities
AssignWhen a record is assigned to a specific user in CRM.User-owned entities only
GrantAccessGrants a security principal (organization, user, or team) access to the specified record.User-owned entities only
ModifyAccessWhen access is modified of a specific record in CRM.User-owned entities only
RetrieveWhen a user or system query or open a single record in CRM.User-owned and organization-owned entities
RetrieveMultipleWhen a user or system queries multiple records in CRM.User-owned and organization-owned entities
RetrievePrincipalAccessWhen a user or system retrieve the access rights of the specified security principal (team or user) to the specified record.User-owned entities only
RetrieveSharedPrincipalsAndAccessWhen a user or system retrieves retrieves all security principals (users or teams) that have access to, and access rights for, the specified record.User-owned entities only
RevokeAccessWhen a user or system replaces the access rights on the target record for the specified security principal (organization, user, or team).User-owned entities only
SetStateWhen user or system changes state of a record in CRM.User-owned and organization-owned entities

What are pipelines in plugins?

When plugins are triggered through the above mentioned messages, they can be configured to run in multiple steps using the execution pipeline of the CRM. Below are the primary plugin pipeline stages.

EventPipeline Stage NameDescription
Pre-EventPre-validationStage in the pipeline for plug-ins that are to execute before the main system operation. Plug-ins registered in this stage may execute outside the database transaction.
Pre-EventPre-operationStage in the pipeline for plug-ins that are to executed before the main system operation. Plugins registered in this stage are executed within the database transaction.
Platform Core OperationMainOperationIn transaction,the main operation of the system, such as create, update, delete, and so on. No custom plug-ins can be registered in this stage. For internal use only.
Post-EventPost-operationStage in the pipeline for plug-ins which are to executed after the main operation. Plug-ins registered in this stage are executed within the database transaction.

In what business scenarios should we choose writing a pluign?

Below are few handpicked scenarios where we can prefer developing a plugin.

  • Executing complex operations which needs data flow between multiple entities.
  • Want to call an external web service on certain events such as saving or updating a record.
  • You want to automate processes such as sending e-mails to your customers on certain events in CRM.
  • Need to execute some business logic such as updating certain fields of a record or updating related records, etc. when you create or update a CRM record.
  • Dynamically calculate the field values when user opens a record.

Thus, we have learned what are the plugins in Microsoft CRM. In our further articles we learn how to develop a plugin and register it in the Microsoft Dynamics CRM 365.

CRM Crate

All In One Platform For Learning Microsoft CRM.

Facebook
Twitter
LinkedIn
5 1 vote
Article Rating
Subscribe
Notify of
8 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Plugin execution pipeline in Microsoft Dynamics CRM - CRM Crate
3 years ago

[…] will learn about the plugin execution pipeline in Microsoft Dynamics 365 CRM. Before we start, click here to understand the detailed concept of plugins in Microsoft […]

How to develop & register plugin in Microsoft CRM? - CRM Crate
3 years ago

[…] logic that is used to trigger and perform an action within Microsoft Dynamics CRM. Before we start, click here to understand the detailed information regarding the plugin in Microsoft Dynamics 365 […]

How to retrieve multiple records in plugin using Query Expression - CRM Crate
3 years ago

[…] What are Plugins? […]

Understanding plugin images in Microsoft Dynamics CRM - CRM Crate
3 years ago

[…] Understanding core concepts of a plugin. […]

Read, update, create and delete record using plugins - CRM Crate
3 years ago

[…] What is a plugin? […]

Custom Virtual Table in Power Apps for retrieving data from an external source - CRM Crate
3 months ago

[…] this blog, we will learn to create a custom virtual table using data provider managed by Power App Plug-ins. Click on the below button to learn how to create a Virtual Table in Power Apps without help of […]

Understanding the 2 Minute Plug-in Timeout in Model-Driven Apps
2 months ago

[…] plug-in serves as a personalized event handler triggered by a particular event occurring during the […]

Difference between Synchronous & Asynchronous plugins - CRM Crate
19 days ago

[…] What is a plugin? […]

error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.