Tuesday, April 26, 2011

Importing Solution to Another Organization Changes ObjectTypeCode

An issue came up yesterday regarding importing one organization's customizations (sitemap, isv.config, custom entities, etc.) into another. While the files imported successfully and everything appeared correct we quickly realized one crucial error we had assumed...

When importing a solution to another organization changes the ObjectTypeCode of every custom entity!

The ObjectTypeCode is the database equivalent of the ETC query string parameter. In simpler terms, any reference to the etc code in the URL of any custom entity will be in correct.
The issue it seems is that when importing, CRM ignores the ObjectTypeCode node in the customizations.xml and instead inserts them alphabetically instead.

So if you had an entity named new_account and it had an etc of say 10100 which typically means its the one hundredth custom entity created, it will now be 10000 since it is the first alphabetically.

So what's the solution?

Some workarounds mentioned around the web and in the msdn forums is to use the ObjectTypeName, abbreviated OTN. If you notice when crm generates the url for a custom entity it adds this as a query string parameter labeled objecttypename=new_account.

So by using this method you avoid using the etc and refer to the string equivalent. I have always assumed this etc number to carry over since its in the xml but its not.

Happy Coding!

Tuesday, April 5, 2011

TechNet Online Documentation for MSCRM 2011


The link above gives you access to the technet documentation.
The navigation to the left will allow to choose from the following:

  • Installation
  • SDK
  • White Papers
The Installation section includes the following:
  • Introduction
  • Planning Guide
  • Installing Guide
  • Operating and Maintaining Guide
The SDK section links to this page which will give developers sample code and quickstart solutions. The Link: http://technet.microsoft.com/en-us/library/gg309408.aspx

The White Papers section currently only houses the Claims Based Authentication but will be expanded soon.

This is a valuable go to resource for any CRM developer!

Happy Coding!