How do I get a list of Object Type Codes from Dynamics 365? (On Line)
What is an Object Type Code?
Every entity/Table in Dynamics has a ‘Type Code’ - a numeric identifier for that table.
Why would I need to know the type code?
Chances are, if you’re reading this page, it’s because you need it. However most of the time a type code is needed for integration purposes or other customizations where you will be accessing the system without the GUI.
Looking to export your Object Type Codes from Dynamics 365 On Prem - See: https://www.thetindog.com/dynamics-as-we-go/object-type-codes-onprem
You can see a list of all the standard type codes here; https://www.thetindog.com/dynamics-as-we-go/object-type-codes-list
Getting Object Type Codes from your Environment
Unlike Dynamics On-Prem there is no direct access to the SQL database behind the scenes. This means that you’ll need to use the Web API to access some of the more technical components of the system.
Step 1
Locate your Dynamics API address. (You can check this entry to help you locate it within your system).
It should look like this for US-based Dynamics environments
https://<Dynamics Instance Name>.crm.dynamics.com/api/data/v9.1
or perhaps like this for Canadian based environments
https://<Dynamics Instance Name>.crm3.dynamics.com/api/data/v9.1
Step 2
Add the following code to the end of the URL from step 1
/EntityDefinitions?$select=LogicalName,ObjectTypeCode
so that your final URL will look something like this
https://<Dynamics Instance Name>.crm.dynamics.com/api/data/v9.1/EntityDefinitions?$select=LogicalName,ObjectTypeCode
Step 3
Finally, paste your completed URL into a browser. (Note; you will need to be logged into Dynamics in order to authenticate and see the data correctly).
You may need to use the browser search facility to locate the entity type code you need, or you could copy and paste into an excel sheet to manipulate the information.
{"LogicalName":"account","ObjectTypeCode":1,"MetadataId":"xxxxxxx-xx-xx-xxxxxxx"}
Related Posts:
Photo by Artem Podrez from Pexels
Applies To:
Dynamics 365 On-Prem
Dynamics 365 On-Line