Friday 8 January 2016

How to get the Object Type Code of an Entity?

Each system and custom entity within Dynamics CRM comes with an array of unique attributes. These include an Entity ID, Logical Name and Object Type Code. Identifying the logical name is pretty easy, however tracking down the rest can be a little tricky.

  • Custom entities will have a Object Type Code greater than 10000. You should also note that the OTC of a custom entity can change when importing the entity to a different system. This is likely when an existing entity on the target system is already using the OTC number.
  • Any system entities will use a Object Type Code less than 10000. This range is reserved for all built in entities.


Using SQL
Execute the following statement against the target CRM Organization database.

SELECT ObjectTypeCode,* FROM ENTITYVIEW 


Using JScript
You can access the "etc" query string parameter from the open entity window within CRM.

Xrm.Page.context.getQueryStringParameters().etc

No comments:

Post a Comment

Action Microsoft.Crm.Setup.Common.Analyzer +CollectAction failed. Fatal error during installation

When installing the Srs Data Connection (Microsoft Dynamics CRM Reporting Extensions), you may have experienced the following error: ...