How do I get a list of Object Type Codes from Dynamics 365? (On Premise)
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 line - See: https://www.thetindog.com/dynamics-as-we-go/object-type-codes-online
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
One of the benefits to running Dynamics 365 On premise is that you have (in most cases) access to the SQL server. In this case, we can query the tables directly to get the list of Object Type Codes - Including any custom tables that you have created within the environment.
Step 1
Open SQL Studio and connect to your Dynamics Server CRM instance
Step 2
Open a New Query window
Step 3
Ensure that your database is selected in the Database drop down menu and enter the following statement into the code panel on the right
select Name, ObjectTypeCode from EntityView order by ObjectTypeCode
Once executed, the code should then return a list of the entity type codes.
Related Posts:
Photo by Artem Podrez from Pexels
Applies To:
Dynamics 365 On-Prem
Dynamics 365 On-Line