CRM 4 – The plugin registration tool won’t build

I have been using CRM 2011 for the past year and I now suddenly have a project which uses CRM 4 and it is very strange going back to CRM 4.

Even trying to build the plugin registration tool was totally different.

I tried adding the dll’s which is what you usually do in CRM 2011 but this didn’t work and it was complaining with this

The type or namespace name ‘CrmSdk’ could not be found

this was because you have to add web references rather than dll’s

Installation Instructions

  1. Double-click the PluginRegistrationTool.sln file to open the solution in Visual Studio 2008.
  2. In Solution Explorer, right-click References and select Add Web Reference.
  3. Add a Web reference to the Visual Studio project named CrmSdk that refers to your Microsoft Dynamics CRM 4.0 server’s CrmService Web service. An example URL is http://localhost/mscrmservices/2007/CrmServiceWsdl.aspx.
  4. Add a Web reference named CrmSdk.Discovery that refers to your Microsoft Dynamics CRM 4.0 server’s CrmDiscoveryService Web service. An example is http://localhost/mscrmservices/2007/AD/CrmDiscoveryService.asmx.
  5. Add a Web reference named MetadataServiceSdk that refers to your Microsoft Dynamics CRM 4.0 server’s MetadataService Web service. An example is http://localhost/mscrmservices/2007/MetadataService.asmx.
  6. Compile the project by clicking Build Solution in the Build menu.
I also had to change the project from .NET 2 to .NET 3.5 and above.

CRM 2011 – Outlook ribbon has gone after CRM 2011 upgrade

Recently Metaphorix has upgraded it’s CRM version from CRM 4 to CRM 2011, I should I upgraded the versions.

I found that some people who had been using older versions of outlook would find they had no Ribbon after the outlook CRM upgrade.

The reason for this was a registry setting which isn’t deleted.  To solve the problem I had to go into the registry and delete a folder called 2.4 and then it worked.

Luckily this is a known problem and Microsoft have a KB article with instructions

http://support.microsoft.com/kb/2494581


To resolve this problem, follow these steps:

  1. Exit Outlook.
  2. Click Start, click Run, type regedit, and then click OK.
  3. Locate the following registry subkey:
    HKEY_CLASSES_ROOT\TypeLib\{2DF8D04C-5BFA-101B-BDE5-00AA0044DE52}
  4. Right-click the 2.4 registry key, and then select Export. Save the export to your desktop to create a backup.
  5. Right-click the 2.4 key again, and then select delete.
  6. Start Outlook.

CRM 2011 – N:N relationships and advanced finds quirks

I was trying to set up a new entity and link it to a contact.

The example in this case was they wanted to have a Language Entity which they could add languages to a contact.  They would then want to search for contacts which had certain languages.

I set up my new language entity put a drop down on it with 5 languages to test with.

I initially created it as a 1:N relationship but this meant every language linked to a contact was a completely new language entity.  so you could have English for contact a and then a new language entity called English for contact b.  When you did an advanced search the two different values would appear.

So I went back and changed the relationship to N:N.

When you create an N:N relationship you get these choices below.  The display options are a bit unusual, do not display?

Although these options seem harmless the display option has big ramifications.  Luckily the CRM Guru Richard Knudson wrote a detailed blog about this which gave me the answer, which you can read here

 

Initially I chose to display the link on one side of the relationship, on the contact.  This caused advanced searches when searching a contact with languages of English to return no results.  Why?

The reason is if you do not display the relationship on both entities it won’t return any results in an advanced find!!!

Richard Knudson sums this up perfectly

Interestingly, it also turns out that if you select Do not Display in the relationship properties, you will not be able to create an Advanced Find query between two record types related with an N:N. So the Do not Display option apparently means “do not display in Advanced Find”, as well as “do not display on the form”.

 

Below I changed the display options this returned no rows, which perplexed me.

 

Another interesting point from the picture above is when you select multiple drop down values it selects those as an or, so I had to add another select to create the AND value I wanted.

Finally someone else in the office was saying this didn’t work in CRM 4 and I think this article from Richard Knudson again backs that up, saying there was something not quite right with N:N relationships and CRM 4

http://www.dynamicscrmtrickbag.com/2010/01/18/many-to-many-relationships/

once again thanks to the mighty Knud for that.

So there we go, once again CRM can act in unusual ways, which shows that experience using CRM is invaluable because the only way you  learn all these quirks is by trying things.