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 :
Microsoft Dynamics CRM (Archived)

Entity Object Type mismatch between CRMs

(0) ShareShare
ReportReport
Posted on by 225

We have a normal CRM setup - Developer (D), Test (T) and Live (L). L was set up first, then T and some time later D. The customisations for D were imported from T but I don't know how customisations were imported into T, I must assume from L as the 3 entities we have a challenge with were part of the original CRM setup.

I have now found that the 3 new entities which were created have an Object Type Code mismatch (seen by doing a side-by-side comparison of exported .xml packages) as follows:

E1, D & T 10001    L 10000

E2, D & T 10002    L 10002

E3, D & T 10003    L 10001

When we try to export/import any of these from T to L we get an error saying that the entity doesn't exist. (Not sure why that should be the case for E2). Can D & T be brought back into synch with L by manipulation of XML or are we faced with rebuilding D & T?

How do I get to see the Entity Object Type Codes without having to view the Customisation packages?

*This post is locked for comments

I have the same question (0)
  • Frank Hermes Profile Picture
    on at
    Re: Entity Object Type mismatch between CRMs

    I would try the following:

    Export the customizations from D or T and replace the following strings with the objecttypecodes from L:

    1. <ObjectTypeCode>10001</ObjectTypeCode>

    2. <returnedtypecode formattedvalue="10.001">10001</returnedtypecode>

    3. object="10001"

    4. objecttypecode="10001"

    Delete the enties in D & T (assuming that you don't mind losing the data there) and import the edited customizations.xml in D, T and L. Now the objecttypecodes should match in all three systems.

    Here's a quick way to get the objecttypecode for an entity.

    1. Browse to this site on your CRM server to get to the SDK aspx page. Tons of information about entities (including the objecttypecode) and their attributes:

    http:/<crmserver>/sdk/list.aspx

    2. Click the definition-icon for the entity in question.

    Or as an sql statement:

    USE <organization>_METABASE
    SELECT Name,ObjectTypeCode FROM dbo.Entity ORDER BY ObjectTypeCode

     

  • Richard MG Profile Picture
    225 on at
    Re: Re: Entity Object Type mismatch between CRMs

    Hi Frank. This is most helpful, thank you. Is there anything I should be aware of before I delete the entities in D and T?

  • Frank Hermes Profile Picture
    on at
    Re: Re: Re: Entity Object Type mismatch between CRMs

    You lose all data stored in this entities. You might experience contraint errors when you delete entities that relate. E.g. if you refer on a form to a linked entity (lookup) you may not delete the linked entity as it appears on a published form. So first delete the lookup from the from, publish it and then delete the entity. Backup your databases before performing the actions.

  • Richard MG Profile Picture
    225 on at
    Re: Re: Re: Re: Entity Object Type mismatch between CRMs

    Constraint errors seem a little scary!:) If I remove constraints presumably at some point I have to set them up again, presumably by importing the affected entity(ies). Might this alternative work as well:

    Assuming the only development on the go involves E1, E2 and E3 - Prepare the customisation packages from D or T as you advise; Export all customisations from L to D (L & D should now be the same); import the revised customisation packages into D; if all is OK, export all to T then, if all OK, export them all to L.

    This seems to involve less work but should end up in the same place. Have I missed anything?

     Also, for the record, if I delete an entity and then add another, CRM places it in the next available Type Object Code. i.e. if I have 10001 and 10003 in CRM (no 10000 or 10002) , if I remove 10001 and then import a new entity, even if the TOC in the package is 10000 CRM will allocate it to 10004 (I've just tried it). Your remedy suggests that if we removed 10001 and 10003, CRM would successfully allocate our new entity to 10000. Is that right?

    This might explain how our mismatch came about originally. The new entities were probably imported individually and in a different order. I don't remember any reference to this in any of the books!

  • Frank Hermes Profile Picture
    on at
    Re: Re: Re: Re: Re: Entity Object Type mismatch between CRMs

    I did not mean to remove any constraints in the database (!) but that contraints might prevent you from deleting entities, therefore you have to choose the right order to delete the entities.

    If you don't delete the entites from a CRM the objecttypecodes will remain the same, thats why your alternative will not work, I think.

    >> if I remove 10001 and then import a new entity, even if the TOC in the package is 10000 CRM will allocate it to 10004

    If you were right then i don't understand how it came your original problem!?

    I don't remember any information on this neither. Take all your courrage and a backup and give it a try ;)

  • Frank Hermes Profile Picture
    on at
    Re: Re: Re: Re: Re: Re: Entity Object Type mismatch between CRMs

    Don't delete the entities in SQL!
    Delete it in the customizations tab in CRM. If any constraints are hurt CRM will tell you. Something like: “You cannot delete XXX because there is a published reference on the form of accounts”. Then remove the lookup from this form and try again.
    Is this what you meant?

    I have another sneaking suspicion: I had once a case when I deleted an entity in the CRM the whole process in the internal CRM did not complete therefore some references in the stored procedures were left and this resulted in errors. It seems that Microsoft did not put the whole deleting-an-entity-process in a transaction. I had to do much handwork in the databases to get this fixed. Hope that this is not the case with your problem.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans