Microsoft have a naming convention for entity codes which you can find on the net
However what if you want to find out a code for a custom entity?
This is the simple solution I use.
-
Goto Settings > Customization and choose your entity
-
Click Forms and Views and double click on the main form
-
Click Form Properties > On Load Event and then click edit
-
Paste the following code into the text area alert("type code: " + crmForm.ObjectTypeCode);
-
Tick the Event is enabled tickbox and click OK and on the next screen OK again.
-
On the top menu select Preview > Create Form
-
Now you get a nice popup box with your entity type code
-
Make sure you quit without saving.