web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Get Object Type Code for entities in Dynamics CRM

Siddique mahsud Profile Picture Siddique mahsud 11
In Microsoft Dynamics We Often need objectTypeCodes while doing data migration from CRM On-Premise to online.

If you have On-Premise CRM then you can query SQL database to get Object Type Codes for any entity. Below query will retrive entity logical name and objectTypeCode list for all OOB and Custom entities.

select Name, ObjectTypeCode from EntityView order by ObjectTypeCode


If you need Just for custom entities then just filter by object type code greator then 9999.

select Name, ObjectTypeCode from EntityView WHERE ObjectTypeCode>9999 order by ObjectTypeCode
                        

For CRM online you can retrieve objectTypeCodes by a Meta Data Call using Web API.

[org Url]/api/data/v8.2/EntityDefinitions?$select=LogicalName,ObjectTypeCode

Filter for Custom Entities:

[org Url]//api/data/v8.2/EntityDefinitions?$select=LogicalName,ObjectTypeCode&$filter=ObjectTypeCode gt 9999

This was originally posted here.

Comments

*This post is locked for comments