SQL error in crmsvcutil after organization upgrading

23 views Asked by At

CRM organization was upgraded from CRM 2011 to CRM 9.1 last week. We tried to generate early bound code with crmsvc util and we get a SQL error.

  • When the crmsvcutils runs on the 2011 organization, it works fine.
  • When the crmsvcutils runs on the 9.1 upgraded organization, it fails because this SQL statement returns an empty result.
SELECT DISTINCT 
    E.EntityId, R.RelationshipId, 
    ERR.EntityRelationshipId, ERR.EntityRelationshipRelationshipsId,
    ERRole.EntityRelationshipRoleId, REC.ConditionId, 
    ALV.AttributeLookupValueId, VA.ViewAttributeId
FROM 
    EntityView E
INNER JOIN 
    RelationshipView R ON R.ReferencingEntityId = E.EntityId 
                       OR R.ReferencedEntityId = E.EntityId
INNER JOIN 
    EntityRelationshipRelationshipsView ERR ON ERR.RelationshipId = R.RelationshipId 
INNER JOIN 
    EntityRelationshipRoleView ERRole ON ERRole.EntityRelationshipId = ERR.EntityRelationshipId
LEFT OUTER JOIN 
    RelationshipExtraConditionView REC ON REC.RelationshipId = R.RelationshipId
LEFT OUTER JOIN 
    AttributeLookupValueView ALV ON ALV.AttributeId = R.ReferencingAttributeId 
                                 OR ALV.AttributeId = R.ReferencedAttributeId
LEFT OUTER JOIN 
    ViewAttributeView VA ON VA.RelationshipId = R.RelationshipId
WHERE 
    E.Name LIKE 'new_reserveentity_rp53fd1p1ekxpa%'

There are no tables or entities named reserveentity or rp53fd1p1ekxpa in this organization.

Why does crmsvcutil require this relationship?

Why does it work fine with CRM 2011?

1

There are 1 answers

0
Daryl On

Make sure you're using the latest version of the Crmsvcutil. If you are, then reach out to Microsoft support. You can also try an older version of the Crmsvcutil as a work around. You can also attempt to use one of the Entity Code generator tools in the XrmtToolBox that do not utilize the Crmsvcutil (The Early Bound Generator V1 does, and V2 uses the PAC Cli which I don't think is compatible with on premise, but the Albanian Code generator doesn't I believe)