Download Microsoft CRM 2011 SDK - SDK voorpagina - CRM Performance - CRM Hosting
Heeft u vragen? Bel ons op 030 800 8008

This walkthrough demonstrates how to register a plug-in by using the Plug-in Registration Tool that is provided as sample code in the Microsoft DynamicsCRMSDK download. The plug-in to register is the FollowupPlug-in from the Sample: A Simple Plug-in topic.

To build and use the Plug-in Registration tool, you must install Windows Identity Foundation.

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 2011 and Microsoft Dynamics CRM Online deployment where your user account has the System Customizer or System Administrator role.

The following prerequisites must be completed before starting this walkthrough:

  • Build the Plug-in Registration Tool according to the instructions in its Readme file. See SDK\Tools\PluginRegistration\Readme.docx.
  • Build the plug-in according to the instructions in its Readme file. See SDK\SampleCode\CS\Plug-ins\Readme.docx
  • Obtain access to a Microsoft Dynamics CRM 2011 or Microsoft Dynamics CRM Online 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.

Connect to the Microsoft DynamicsCRM Server

  1. Run the Plug-in Registration tool.

    The Microsoft.Crm.Sdk.Proxy.dll and Microsoft.Xrm.Sdk.dll assemblies must be in the same folder as the tools executable or in your computers global assembly cache in order for the tool to run.

  2. Click Create New Connection.

  3. In the Connections pane, under Connection Information, type a name for the connection, the URL of the server where the Microsoft DynamicsCRM discovery service is hosted, and your logon user name.

    Connection form fields

  4. Select the Use Saved Credentials option if your logon credentials are saved in the Windows credential cache on your computer. Otherwise, do not select this option; you will be prompted to enter your password.

  5. Click Connect.

You should see a list of available organizations that you belong to in the Connections pane.

Register a Plug-in Assembly

  1. Select an organization in the Connections pane.

  2. From the Register menu, and then click Register New Assembly.

    Register Assembly menu item

  3. In the Register New Plugin dialog box, click the ellipses [] button to the right of the Step#1 field.

  4. In the Select Plug-in Assembly dialog box, move to the location of the compiled SamplePlugin.dll assembly. The default location is SDK\SampleCode\Plug-ins\bin\Debug. Select the assembly, and then click Open.

  5. In the Step#2: Select the Plugin & Workflows and Activities to Register section, expand the SamplePlugins assembly to view all plug-ins in that assembly. Select only the Microsoft.Crm.Sdk.Samples.FollowupPlugin plug-in.

  6. In Step#3: Specify the Isolation Mode section, select the Sandbox option.

  7. In Step#4: Specify the Location where the Assembly should be stored section, select the Database option.

    Register New Assembly dialog

  8. Click Register Selected Plugins. Click OK to close the dialog boxes.

The SamplePlugins.dll assembly and FollowupPlugin plug-in are now registered and deployed to the server.

Register the Plug-in for an Event

  1. Select (Assembly) SamplePlugins in the tree view, move to the Register menu, and then click Register New Step.

    Plug-ins are registered to execute when an event is processed in the event execution pipeline. Each event has a stage name and number to indicate its location in the pipeline either before or after the core platform operation. A step refers to the SDK message processing step entity that is used to configure how the plug-in is to be executed.

  2. Complete the Register New Step dialog box as shown in the following figure.

    Register New Step dialog

    *If you want to register the plug-in to execute immediately (for testing purposes), select Synchronous.

  3. Click Register New Step.

  4. Expand the (Assembly) SamplePlugins node 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.

    To unregister the step, plug-in, or assembly, select its node in the tree, and then click Unregister.

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.

Test the Plug-in

After you register the plug-in you can optionally test its execution by using the following procedure.

Test the Plug-in

  1. Open the Microsoft DynamicsCRM Web application for the same organization that you registered the plug-in assembly under.

  2. Move to the workplace, select Accounts, and then click New.

  3. In the Account Name box, type an account name, for example, Adventure Works Cycle, and then click Save & Close.

  4. Double-click the form name in the Accounts grid to open the form.

  5. Click Activities to display a list of related activities for the account. You should see the activity named Send e-mail to the new customer that the plug-in created.

  6. If you registered the plug-in to run asynchronously, and did not select the Delete AsyncOperation if StatusCode = Successful option on the Register New Step form, there will be a new system job named FollowupPlugin: Create of account. To view the related system job, click Settings, and then click System Jobs. Double-click the system job previously mentioned.

You can now unregister the step, plug-in, and assembly if you want. You may also want to delete the system job and account that you created.

See Also

©   Hosting -  Performance -  Upgrade -  Nieuw -  Over ons -  Contact -  CRM 2011 proberen

2AT - Netricity - CRM boeken

Microsoft Partner? Bekijk hier ons partner aanbod