Plugins Development in Dynamics 365 CRM | Part 2 – Registering your plugin

Given that you are coming here from the Part 1:

Let’s register our plugin to the Dynamics 365 CRM organization using the Plugin Registration Tool!

Log into Plugin Registration Tool

Based on where you have downloaded the Plugin Registration Tool, navigate to the folder and follow the below –

  1. Open the Plugin Registration Tool from the directory.

  2. Now, given that this is Dynamics 365 CRM Online (Customer Engagement / Dataverse) environment, you’ll make sure Office 365 is selected and then you’ll need to enter Admin Credentials.

  3. Once successfully authenticated, you’ll be asked to choose which organization this is in. Given that development should ideally be done on a Dev/Sandbox environment, you’ll select the appropriate environment here.

  4. Once logged in, you’ll see the the assemblies registered with the CRM environment. These are the out-of-the-box assemblies which are not supposed to be manipulated.

Register your Assembly

Let’s register the Plugin Assembly –

  1. Click on the Register New Assembly button and click on New Assembly

  2. You can now click on the three dots in order to navigate to the .DLL file which was generated when you Build the project.

  3. You’ll then need to navigate to the bin folder (Either Debug or Release)

  4. Once you select the .dll file, you’ll see the plugins which are exposed in the dll i.e. the Plugins of .CS of ‘public’ visibility.
    Once this looks good, click on the Register Selected Plugins

  5. Upon successful registration, you’ll see the below message.

  6. And your Assembly will now be registered successfully using the Plugin Registration Tool.

  7. In case this Project was not signed with .snk file, you’d see the below message.
    Assemblies containing Plugins must be strongly signed. Sign the Assembly using a KeyFile

    Now, the assembly has been registered. Next, we’ll add a step (you can call it a trigger for the plugin to start executing)

Register Step for Plugin

Now, let’s register a step for the Plugin –

  1. Now, given that the Assembly was successfully Registered, the next step is to Register a Plugin Step.
    Expand the Assembly, then expand the Plugin itself to which you want to add a Step.

  2. As per the scenarios from Blog 1, the plugin is supposed to be triggered on change of the Account’s field Group Code.
    So, when you click on Register New Step, you’ll get to configure the Step
    Here, Message means the “operation” on occurrence of which the Plugin should be triggered. In this example, we want to trigger the plugin on an Update operation.
    Primary Entity denotes which entity is this targeted at. Account in this example.
    Then, the Filtering Attributes is available if the Message is set to Update since Filtering Attribute let’s you select which all fields should be listened to in order to run/trigger the plugin.

  3. Clicking on the three dots, you’ll get to choose the fields. In this example, we’ll select the Group Code field.

  4. Once you click OK after choosing what all fields the plugin should fire on, you should select “under whose security context should the plugin be running”
    Run in User’s Context is that field to choose the user.
    In my practice, I choose either Calling User or a System Administrator

  5. Finally, I’ll choose “when in the context of the operation” should the plugin be triggered.
    Since, I want the plugin to run “after” the “Update” operation is performed, I’ll select PostOperation.
    And Execution Mode has options – Asynchronous / Synchronous defines if the plugin will run in the background or with the operation itself.

  6. Once I choose these preferences, I’ll click on Register New Step and the Step will be registered on the Plugin.

  7. At this point, you’ve successfully registered the plugin assembly and a step on the plugin to be triggered on the update of the Account field – ‘Group Code’.

But we haven’t written any logic in place, right? So Part 3 we’ll write a short logic to add meaning to this tutorial

Link to Blog 3:

Hope this was helpful! Here are some more Dynamics 365 posts which you might be interested in –

  1. Dynamics 365 Storage Utilization | Dataverse Storage | Power Platform Admin Center
  2. Use Hierarchy in Roll Up Fields in Dynamics 365 CRM
  3. Filter records in a View owned by a Team you are a member of | Dynamics 365 CRM
  4. Get GUID of the current View in Dynamics 365 CRM JS from ribbon button | Ribbon Workbench
  5. Dynamics 365 App For Outlook missing on SiteMap in CRM? Use shortcut link [Quick Tip]
  6. Import lookup referencing records together in Dynamics 365 CRM | [Linking related entity data during Excel Import]
  7. Mailbox Alerts Hide/Show behavior in Dynamics 365 CRM
  8. Excel Importing Notes (Annotation) entity in Dynamics 365 CRM
  9. Enable/Disable the need to Approve Email for Mailboxes in Dynamics 365 CRM CE
  10. Call Azure Function from Dynamics 365 CRM using Webhooks
  11. Show Ribbon button only on record selection in Dynamics CRM
  12. Accessing multiple occurrences of a field in Business Process Flow using JS in D365 CRM

Thank you!!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.