This walkthrough demonstrates how to register a plug-in by using the Plug-in Registration tool that is provided in the SDK. The plug-in to register is the FollowupPlugin from the Sample: Create a basic plug-in topic.
The plug-in is to be registered on the account entity, CreateRequest message, on a post-event, and in the sandbox. The plug-in can be registered on any Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update deployment where your user account has the System Customizer or System Administrator role.
Register a plug-in assembly
Register a plug-in step for an event
The plug-in is to be registered on the account entity, CreateRequest message, on a post-event, and in the sandbox. The plug-in can be registered on any Microsoft Dynamics CRM 2015 and Microsoft Dynamics CRM Online 2015 Update deployment where your user account has the System Customizer or System Administrator role.
The following prerequisites must be completed before starting this walkthrough:
- Get the PluginRegistration.exe tool, located in the Tools\PluginRegistration folder of the SDK. Download the Microsoft Dynamics CRM SDK package.
- Obtain a system user account on a Microsoft Dynamics CRM server.
- Your user account must have the System Customizer or System Administrator role. See How role-based security can be used to control access to entities in Microsoft Dynamics CRM.
- Run the Plug-in Registration tool.
- Choose CREATE NEW CONNECTION.
- In the Login dialog, select the deployment type radio button corresponding to the Microsoft Dynamics CRM server you intend to register plug-ins with. The On-premises radio button includes an IFD deployment, the Online button is for the Windows Live provider of Microsoft Dynamics CRM Online, and the Office 365 button is for the Microsoft Online Services provider of Microsoft Dynamics CRM Online.
- If you check Always display list of available orgs, you are presented with a list of organizations that you belong to after you choose Login. This enables you to choose the organization that you want to register the plug-in with. Otherwise, your default organization is used.
- Enter the indicated information about the server and login account, and then choose Login.
You should see a collapsed list of registered plug-in or custom workflow activity assemblies and service endpoints. The activity feeds and Microsoft.Crm.ObjectModel assemblies are required for Microsoft Dynamics CRM to function properly so the tool prevents you from altering them. Selecting an item in the list results in the Properties and Details tab panes displaying information about that list item.
Register a plug-in assembly
-
Select an organization tab to make it active.
-
In the toolbar of the tab, choose Register and then Register New Assembly.
-
In the Register New Assembly dialog box, choose the ellipses […] button to the right of the Step#1 field.
-
In the Open dialog box, navigate to the location of the compiled SamplePlugin.dll assembly. The default location is SDK\SampleCode\CS\Plug-ins\bin\Debug. Select the assembly, and then choose Open.
-
In the Step#2 section, expand the SamplePlugins assembly to view all plug-ins in that assembly. Select (check) only the Microsoft.Crm.Sdk.Samples.FollowupPlugin plug-in.
-
In the Step#3 section, select the Sandbox option.
-
In the Step#4 section, select the Database option.
Choose Register Selected Plugins. You can close any open dialog boxes.
Select an organization tab to make it active.
In the toolbar of the tab, choose Register and then Register New Assembly.
In the Register New Assembly dialog box, choose the ellipses […] button to the right of the Step#1 field.
In the Open dialog box, navigate to the location of the compiled SamplePlugin.dll assembly. The default location is SDK\SampleCode\CS\Plug-ins\bin\Debug. Select the assembly, and then choose Open.
In the Step#2 section, expand the SamplePlugins assembly to view all plug-ins in that assembly. Select (check) only the Microsoft.Crm.Sdk.Samples.FollowupPlugin plug-in.
In the Step#3 section, select the Sandbox option.
In the Step#4 section, select the Database option.
Register a plug-in step for an event
-
In the Registered Plug-ins & Custom Workflow Activities tree view, expand the (Assembly) SamplePlugins node and select a registered plug-in
2. Navigate to the Register menu in the toolbar, and then choose Register New Step.
3. Complete the Register New Step dialog box as shown in the following figure.
-
Choose Register New Step.
-
Expand the (Assembly) SamplePlugins node and sub-nodes to see the plug-in and step nodes you created. You can now close the tool, but you may want to keep it open until after you test the plug-in and unregister the assembly.
The plug-in is now registered to execute in the sandbox, for an account create event, and after the core operation executes. You registered the plug-in to run asynchronously since the creation of the follow-up task activity is not time critical. After an account is created, the plug-in will execute the next time the asynchronous service processes its queue.
- In the Registered Plug-ins & Custom Workflow Activities tree view, expand the (Assembly) SamplePlugins node and select a registered plug-in
2. Navigate to the Register menu in the toolbar, and then choose Register New Step.
3. Complete the Register New Step dialog box as shown in the following figure.
Choose Register New Step.
Expand the (Assembly) SamplePlugins node and sub-nodes to see the plug-in and step nodes you created. You can now close the tool, but you may want to keep it open until after you test the plug-in and unregister the assembly.





No comments:
Post a Comment