Here’s a quick and easy way to update a plugin assembly in CRM to give much quicker turn around when developing. Note: this will only work if the plugin is deployed to the database.

Plugin assemblies work just the same as all other entities in CRM, which means you can make API calls to retrieve, create or update them. While there is a bit of effort involved in creating new assembly records in CRM and all the associated plugins, steps, images etc. If you want all that to remain the same and to just simply update the deployed code, all you need to do is the following:

var pluginAssembly = new Entity("pluginassembly")
  Id = new Guid(pluginAssemblyId),
  Attributes =
    {"content", Convert.ToBase64String(File.ReadAllBytes(assemblyPath))}

Where pluginAssemblyId is the id of the assembly you want to update, assemblyPath is the path to the assembly file on disk that you want to deploy and crmService is an authenticated OrganizationServiceProxy (see: my previous post to see how to initialise one)

If you don’t know the id of the assembly, you can look it up via the name first:

var pluginAssemblies = crmService.RetrieveMultiple(new QueryExpression("pluginassembly")
  Criteria = new FilterExpression
    Conditions = {new ConditionExpression("name", ConditionOperator.Equal, name)}
var pluginAssemblyId = pluginAssemblies.Entities[0].Id;

Assuming the plugin name is the same as the assembly file name, you could also just pull this from the path:

var name = Path.GetFileNameWithoutExtension(assemblyPath);

  •   Posted in: 
  • CRM

This is an updated list – to extend the original list I made in the post here – of the Javascript bookmarks I have in my browsers, to make my life a bit easier as a power user in CRM. While the latest updates have made navigation a bit easier (especially with the addition of an advanced find button on all screens), I still find many of these links easier and quicker to use.

I have left the bookmarks unformatted because I am a bit lazy, but also so they can just be copied into a new bookmark url box without the new lines messing things up. This does mean that they don’t display so well here, so be warned.

GodMode: I picked this one (including the name) up somewhere along the way (sorry, I can’t find the original link to credit them with it), but tweaked it slightly. This essentially unlocks forms for you. It shows all hidden fields, unlocks all locked fields, clears all notifications and expands all tabs and sections. Use with caution as it can potentially circumvent client side controls and allow you to do things that users shouldn’t normally be able. However, anything important is actually being validated server side as well? Right?


ShowSchemaNames:This does what it says on the tin: replaces all the field labels on the form with the schema names. This is useful as a developer when you need to know the name of the field to use in code and saves time instead of opening up the form or customisations.


GetUrl:Pops up a dialog box with the URL of the current record in it. This gives you a quick way to grab a link to send to someone or open in a new window.


OpenProperties:Opens the properties page that existed in CRM 2011, but isn’t accessible anymore. Gives you an easy way to see created/modified by/on etc.


OpenById:Know the schema name and Id of a record that you want to view? Enter those two bits of info in the dialogs that pop up and away you go.


GoTo… (the following navigate you to the specified section within the CRM organization you are currently looking at.















Users(2013 – where Users is under the Administration section in CRM)


Users (2015 – where Users is under the Security section in CRM)


This post follows on from my post last year about registering Service Endpoints in CRM to send messages to an Azure Service Bus.

If you make use of this functionality and were not aware of the pending certificate expiry for CRM you may have had the unpleasant experience of the messages being sent to the service bus queue (or topic etc) failing in the last week or so (as of 7 March 2015). Basically, for security enhancements the existing certificate expired and a new one was issued to authenticate against the Azure service.

All the information you need is here:

To summarise (and in case that link no longer works): If I was organised and got this post out early, the recommendation would be to login to the access control page for your service bus namespace (https://<servicenamespace> and under Service Settings –> Service Identities add the new certificate for your region (this can be downloaded from your CRM instance under Settings –> Customizations –> Developer Resources or from the links in the article link above). By having the two certificates installed side by side, you would have been able to have continuous service as they transitioned over and could then remove the old certificate at your own time. Now that it is past the expiry date, if you do not have the new certificate installed you should get this installed ASAP and can just replace the existing one. Once the new certificate is installed (give or take a few minutes for the change to propagate), you should be all good to go again.

So there we go. As with a lot of certificate expiry related issues, there is little to no notification that they are about to expire, so is something that as system administrators we need to be aware of and manage accordingly. We now have a few years to get ready for the new certificate here to expire and need changing again.

I do not particularly like workflows in CRM. Custom workflows in particular. While I concede there are cases where workflows in CRM can work and that certain custom workflows are useful to add additional capabilities to something a power user can control, from my (albeit rather limited) experience, they are often used (or abused?) outside these situations. Especially where a plug-in would be much better suited.

Unfortunately, I have ended up with a project full of them. With over a hundred different processes and 22 custom workflow assemblies referenced by more than 50 them (some referencing multiple), the system is not my perspective of ideal. Regardless, it has fallen to me to upgrade this CRM4 code base and start to get the system in shape for a future move to CRM2013. 

In preparation for this upgrade I was testing the approach to upgrade the workflows and referenced libraries from .NET 3.5, 3 or earlier and replacing references to CRM4 libraries (i.e. Microsoft.Crm.Sdk) with CRM2011 libraries (i.e. Microsoft.Xrm.Sdk etc) and everything that comes with that (replacing CRM4 types: CrmBoolean, CrmNumber, Lookup, DynamicEntity etc). My initial finding was that an in place upgrade of the code would break a deployed workflow. When you deployed the new assembly it seemed to be fine, however new instances of the workflow will fail. If you try deactivate the workflow and edit it you see this:


All the steps that reference the custom workflow show an error message and you can't open them to edit or delete them. Other than the error icon, it doesn't provide much information as to what is wrong. To have a look at what was going on, I exported the workflows in a solution and had a look at the XAML. Turns out the workflow itself has references to the input field types and being originally CRM4 based, these are the old CRM types, for example CrmNumber. It seems that this doesn't reconcile when CRM sees the new code that we deployed so it gives up. 

The first fix that came to mind here was to update the XAML to fix these references. This is a bit of a pain, but only really another set of find and replaces. However, it turns out there is a much simpler fix within CRM. All you need to do is open up the workflow (deactivate it if it is active) and then open the properties for the custom activities input (the first Set Properties button in the screen shot above). This will show the inputs for the custom workflow, which should all look the same as before. You don't actually need to change anything here (unless you want to of course), so just save and close out. Again, it looks like nothing has changed and the errors are still there, but hit save and close again. Now just open it up again and all of a sudden the errors are gone.


How easy is that! Simply saving the input parameters must trigger CRM to check and update all the parameter types for the workflow, which means the output parameters now match what is expected and the workflow can happily be activated and run. You can confirm this by exporting the workflow again and looking at the XAML.

Awesome, so it seemed like my workflow headaches were going away. That is, until I realised that unlike CRM2011 workflow assemblies, CRM4 did not require the assembly to be signed… and if you sign an assembly it changes the strong name, which means it will not let you provide it as an update for the deployed code, so the above fix was not going to be enough for everything that I was facing... However, how I went about fixing that is a story for another day.

  •   Posted in: 
  • CRM

Do you know what the selected option below is:


Until I starting playing with Azure and discovered that CRM has built in functionality to send messages to the Azure Service Bus (i.e. this) I didn’t even give it a moments thought. This option in the CRM plugin registration tool is the entry point to getting your solution talking to Azure and opening up some new and exciting opportunities.

In this post, I will quickly run through how to register a new service endpoint, which is a little bit more complex then just clicking the highlighted option. This will include how to create the service bus in Azure. In a later post I will discuss what you can do with this once it is up and running.

First up, you need to create the service bus in Azure. If you don’t already have an Azure subscription jump on to and sign up for a free trial. For this example we will use a Queue, but there are several other options that you can use as well, each provides different capabilities. I won’t screen shot every step, but this is a simple case (as of the time of this post – Azure may change all of this in the future) of clicking on the following:

  1. + NEW
  4. QUEUE
  6. Specify Queue Name, Region and either use existing or create a new namespace
  7. Configure the queue with the options you want.
  8. Make sure Enable Partitioning is unticked, otherwise you won’t be able to use it with CRM
  9. Click the tick icon down the button to accept

Azure will then go away and in a minute or two finish creating and activating your service bus.

Next up, we need to get the connection information to plug into CRM and get it talking to your new service bus. To get this information you need to select the service bus (note: there is a difference between selecting the service bus and going into it and seeing the queues, you need to click on a column other than the Namespace Name to select it) and click CONNECTION INFORMATION at the bottom of your screen. All you need from this screen is the default key and they provide a copy button beside it if you are too lazy to select and copy it yourself.

Now we can get back to that initial image. Connect the plugin registration tool to your CRM organisation and hit Register New Service End Point:


In this screen fill in:

  1. Name: the name you want to call this connection
  2. Description: an optional description of what this is for
  3. Solution Namespace: the name of the service bus namespace you created or used in Azure above
  4. Path: the name of the queue you created above
  5. Contract: Queue (for this example at least)
  6. Claim: None
  7. Federated Mode: Unticked

Then click Save & Configure ACS and you should see this screen:


Fill in:

  1. Management Key: The default key you copied from the connection information screen in Azure earlier 
  2. Certificate File: In CRM browse to Customizations, Developer Resources (or just click the link in the dialog shown above), download the certificate and browse to where you downloaded it
  3. Issuer Name: You will find this in the same place as the certificate. Should be something along the lines of or depending on your region.

Then click Configure ACS and if everything goes well, close the dialog, save and verify, save again and you are done. You should now have a brand new service endpoint configured in CRM. This will not do anything yet, but in my next post I will show you some things you can try. The CRM SDK is also a great source of sample code to carry on from this.