CRM – Registering Plug-ins Made Easy


PluginRegistration tool v 2.0

Are you facing problems in registering plug-ins? Are you wondering if you could get a tool to generate the Xml and deploy plug-ins via Import/Export just like the way customizations are deployed? Are you confused with the various tools that shipped with SDK and how to use the registration API? If the answer is yes, then read this blog post.

CRM 3.0 exposed callouts so that ISV / Partner can extend CRM and run custom code when an action is triggered in CRM. Well, there were about 10 messages available to register the callouts. In Microsoft Dynamics CRM 4.0, the concept has been expanded to 64 messages. Now a plug-in could be registered on messages like ‘GrantAccess’ ,’ImportAll’. One more major enhancement is to expose the API for registering the plug-ins and steps (eg: On Post of Contact Create fire MyPlugin.Execute() method). The migration is good as the registration data is now stored in the database and customers do not have to worry about the pain in merging callout.config.xml and deploying the xml manually on all machines. This brings us to the question on the blog on how to write the API and if there is a tool to do this automatically.

There are 2 great tools that were shipped with the Microsoft Dynamics CRM 4.0 SDK.

  • PluginDeveloper is a command line tool that accepts Register.Xml and allows one to register the assembly, plug-ins, steps and images at one shot. Main limitation of the tool is that one has to generate the Xml with all the right values.
  • PluginRegistration is a UI tool that allows users to do finer tasks like registering / unregistering the assembly, plug-in, and steps. It has the capability to display what plug-ins are registered in the CRM. It is very developer friendly as user can learn by clicks. Drawback of the tool is number of clicks needed to re-do any work that is done previously.

Let’s talk about the interesting part of this blog “New and re-engineered PluginRegistration tool” that has tons of new features and a brand new UI. There are 3 core scenarios that were addressed in this tool.

1. Developer Scenario: An ISV creates a plug-in and registers it on Contact Create as PreCallout (Aka BeforeMainOperation Plug-in). He can then debug the plug-in by registering on Disk. Once the errors are fixed, he can then update the pluginassembly to be uploaded to the database.

2. Deployment Scenario: An ISV builds few plug-ins and registers on multiples steps. Images are registered on few of them. He tests them in the Dev environment but would like to port the registrations to a different organization. PluginRegistration tool supports Export and Import of the solution xml to solve this scenario.

3. Admin Console: Couple of ISV installs their plug-ins on a Customer Organization. Admin at the Customer side saw some problems with “Contact Create” action. He would like to know what plug-in are fired and what the pipeline is for the “Contact – Create”. He then finds the trouble causing plug-in and disables it. So it is all about troubleshooting. PluginRegistration tool solves this problem by allowing Enable/Disable/Unregister operations on steps, plug-in.

Complete feature-set of the tool

  1. Register a pluginassembly, step and image. Validates the data before sending to CRM
  2. Update pluginassembly, step and image
  3. Unregister a pluginassembly shall cascade unregister all the children
  4. Enable, Disable a step
  5. Auto retrieve all CustomEntities information from the organization when registering the step
  6. Allows setting more values on step (e.g.: configuration, secureconfiguration, filteringattributes, etc.)
  7. Auto retrieve CustomAttributes on entity when registering images
  8. Search the pluginassembly, type, steps, images by names
  9. Visualize the status of the CRM Organization multiple views
    1. View by Assembly : What steps are registered on what plug-in
    2. View by Entity : What steps are registered on an entity(e.g.: contact)
    3. View by Message : What steps are registered on a message (e.g.: create)
  10. Shows the list of Microsoft Dynamics CRM 3.0 callouts registered in the organization
  11. Work with multiple organizations at the same time
  12. Exports the Xml in the same format that can be accepted by PluginDeveloper tool

PlugIn

PluginRegistration Tool can be downloaded from the following location. You need to add references and build it locally. Once built, it can be used with any organization. Walkthroughs and ReadMe are included in the download.

http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=crmplugin&DownloadId=320

I hope this article helps jump start the plug-in registration process for you and eases some pain when building rich business applications in Microsoft Dynamics CRM 4.0.

Thanks

Ajith Gande

http://code.msdn.microsoft.com/crmplugin

Comments (20)

  1. CRM 4.0 Plugin Registration Tool

  2. Did you see this post at blogs.msdn.com

  3. Merit Solutions, Inc. – Ajith Gande (Microsoft Dynamics Software Developer) has published an updated version of of the Plugin Registration Tool – which had some basic examples featured in the SDK.The Microsoft Dynamics CRM Team Blog has posted all of

  4. Ajith and friends had posted article about plug-in registration tools on CRM blog ( http://blogs.msdn.com/crm/archive/2008/02/04/crm-registering-plug-ins-made-easy.aspx

  5. Ajith and friends had posted article about plug-in registration tools on CRM blog ( http://blogs.msdn

  6. CRM 4.0 Plug-in Developer Tool Extended

  7. A very nice interface, all functionality in it, Export & Import and open source! http://blogs.msdn

  8. I have searched a lot, and I did not see a complete tutorial on how to work with plugins. Here it is

  9. Kamal says:

    Created a plugin using the tool and then went back and updated my .net class and tried to update the registration using the button at the top of the tool but nothing happened? Am i doing anything wrong or does the Update work?

  10. For those of you starting to develop Plug-Ins in CRM 4.0, there is a great tool that was developed to

  11. AjithG says:

    Kamal,

    There was a bug in the tool on Update of the Pluginassembly which was corrected on Feb 21. Dowsnload the latest version and you shoudl be good to go.

    Thanks

    Ajith

  12. CRM 4.0 enhanced the concept of plug-ins (called callouts in earlier versions). Plug-in’s are now supported

  13. Maria says:

    Works great for *one* organisation. I added a second organisation where I didn’t want the plugins to be fired, so naturally I didn’t register them for that organisation. Somehow it still thinks they ought to be there, because when I create an instance of an entity (which would cause a plugin to fire in organisation A, but shouldn’t in organisation B) it fails with the error message: "Unable to load plug-in assembly".

    Well, yes, obviously. Because it’s not there. But neither is it supposed to be! So why is it still trying to load plug-in assembly when no plugin has been registered for that organisation?

  14. Ajith says:

    Maria

    I assume that you are workign with CRM 4.0 plugins. You registered on OrgA. Can you connect to Org B and see if you see any plugins or Steps then they are registered in that org too.

    Please check the Url when you connect to the Second Org. You should see the Url containing the Org name.

    I think you might still be connecting to the First org.

    Thanks

    Ajith

  15. Taj says:

    Hi Ajith,

    I am using the registration tool to register a plug in I developed.

    It was registering my plugin in my development environment without any problem.

    But when I tried to register the plugin with the tool who has a proxy settings (proxy username and password is different from the server user name and password) I was getting an exception : unauthorised code 401.

    Is it because of their proxy settings?

    Is there any possible walk around for this problem?

    I appreciate your help

  16. Anurodh says:

    I was looking at the xml file of the plugin developer. I am quite new with this stuff and i dont really understand when to use CustomConfiguration string, when to use asynchronous vs sychronous modes and stuff like that. Can anyone direct me to a source which explains these things in detail.

    Thanks in advance

  17. AjithG says:

    Taj

    Try making the SDK call from the machine using proxy username and passwd, if that works then the same should happen to the tool. Tool uses SDK to autheticate. so you need to troubleshoot the AD suthentication from the proxy server.

    I suspect that the Discoveryservice is returning the Url which is not valid from your proxy server which might be causing the issue. Look at the url returned by Discoveryservice.

  18. VolkerS says:

    Hi Ajith,

    I am trying to register my first CRM 4.0 plug-in using your tool. It’s working just fine using the "Database" option. However, when I select the "Disk" or "GAC" option, I am able to register the new assembly and new step, but the CRM is unable to load the plug-in and is giving me the following message "Unable to load the plug-in assembly". The assembly file is not stored anywhere on my CRM server after the registration ("Disk" – C:Program FilesMicrosoft Dynamics CRMServerbinassembly — "GAC" – C:WINDOWSassembly)

    Why is the registration successful, if the assembly file has not been deployed?

    Thanks in advance!

    Volker

  19. This is a long overdue post that is a follow-up to 2 other posts I had. Recently I published Take 2 of

  20. Craig says:

    This tool has certainly come on from the initial SDK version from January 2008, I was delighted to see the support for multiple organisations in the CRM enterprise edition etc.

    A question, is it possible to use 1 plugin assembly and register it when creating a "Step" to be fired for both the Create and Update events. If I try to enter both the tool gives an error.

    Even with the plugindeveloper tool and the manual register.xml file I have found no way to do this so I have to create 2 signed assembly projects, one for Insert and another for Update.

Skip to main content