- Connection to server
- Registration of assembly
- Registration of plug-in
Connection to server
Step 1 - Run PluginRegistration.exe from the location specified previously. Click the Create a new connection button.
Step 2 - In the login window, choose Office 365 because we are using the online version of CRM. Enter your contact detailsidentification and click on Connection.
Step 3 - The tool will open and look like the following screenshot.
Saving the assembly
Step 1 - Go to Register → Register New Assembly.
Step 2 - This will open the Save New Assembly window. Click on the Browse icon and locate the plug-in DLL that you created in the last chapter.
Step 3 - After browsing the DLL, click Load Assembly. This will populate the SamplePlugins assembly and all its plugin classes. You can see the PostCreateContact plugin class highlighted below. If your plugin assembly had 3 plugin classes, it would have shown three plugins listed here.
Step 4 - Select isolation mode as sandbox, location as base data and click on Register selected plugins. It will show you a success message, if the registration is successful.
Registering the plugin
We will now record the specific stepsues on which the individual plugins will be called.
Step 1 - Select the PostCreateContact plugin.
Step 2 - Click on Save → Save a new step.
Step 3 - We will register this plugin when creating the Contact entity, in post-operation and in synchronous mode.
Message - Create
Main entity - Contact
Execution step of the event pipeline - Post-operation
Execution Mode - Synchronous
Keep the rest of the default options and click Save a new step.
You can see a new step added to the plugin.
We will now go to CRM and test if our plugin is working correctly. Note that these test steps are specific to our plugin example.
Testing the plugin
Go to the Contacts tab and create a new recording. Once the recording is saved, you can see a new activity created and associated with this recording.
You can click on the acactivity to see the details we defined in the code.
This confirms that our plugin has worked successfully. Likewise, you can extend your plugins to get very complex functionality.