| Hammad Hussain
Plugins in Dynamics 365
Microsoft Dynamics 365 provides numerous extraordinary out of the box (OOB) properties. However, numerous business scenarios demand enhancements to the OOB framework that require executing customized logic. This customization can be accomplished in different ways, including Java Script, Custom Workflows, Custom Reporting, Scheduling Jobs, writing Plugins, etc.
Plugins are presumably the most common and are a top choice of developers with regards to executing customized logic around entity actions such as Create, Update, Delete, Associate, and Disassociate.
A plugin is a class library that can be written in .Net platform-supported languages, including C# and Visual Basic. Class libraries - which are compiled into a DLL record (and more than one plugin can be essential for a solitary DLL document - should be enlisted in the Dynamics 365 environment. Customized logic in plugins coordinates with Dynamics 365 to perform required business processes.
Let’s talk about how it works:
Step 1: Preparation
First of all, we want an IDE to get everything rolling with plugin development. In case you don't already have them, download a Visual Studio and .Net Framework from Microsoft's official website. The latest version of Dynamics 365 can support customized code made with Framework version 4.5.2 or later.
Then, in case you don't already have it, now is the right time to Install Microsoft Dynamics 365 Customer Engagement Developer Guide (recently known as CRM SDK). As of Dynamics 365 v9, there could be presently not a Microsoft-provided download for the Software Development Kit (SDK). But, by utilizing either PowerShell or NuGet, we can in any case install the developer tools, assemblies, and code samples that are installed as part of the SDK for Dynamics 365 v9.
Step 2: Write a Plugin
Now we want a placeholder for our customized code, so pick a development language and then create another Solution and Project in Visual Studio. Note that we cannot generate an executable file without having a Project and Solution.
Next add a "Class" and determine a class name for the plugin. This is where we would compose a code to implement business logic. Extend the class from Microsoft.Xrm.Sdk.IPlugin.
The SDK assemblies are available as NuGet packages that you can straightforwardly use in your Visual Studio projects.
Step 3: Register a Plugin
To register the plugin with Dynamics 365, we can utilize the Plugin Registration Tool by installing it with Nuget or by using XRM Toolbox Plugin Registration.
Start the process by entering all necessary connection information to establish a connection with the required Dynamics 365 organization. While registering new plugin step, we select PrimaryEntity and the Message activities (Create, Update, Delete, Associate, and Disassociate) for the plugin that is being Created/Updated.
Join us next time, as we continue our journey of learning canvas apps.Click here to learn more about Imperium's Power Apps Services. We hope this information was useful, and we look forward to sharing more insights into the Power Platform world.