Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM forum
Answered

ObjectTypeCodes for custom entities different in UAT environment

Posted on by

Hello,

Today we noticed that something weird has happened when moving a managed solution package to an Acceptance environment - the ObjectTypeCodes for the custom entities had different values than in the Development environment. Since we have view filters based on the entities (for Connections) we get weird results. We also checked how things are with the Test environment and there everything was according to the expectations.

Anyone ideas how this has happened and a possible fix for it?

Cheers

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,166 on at
    RE: ObjectTypeCodes for custom entities different in UAT environment

    Right - got it.

    Rather than refer directly to the entity type code in the view - you can use 'Starts With' and then use the name 'User'. This will generate fetchxml that doesn't use the typecode but looks at the typecodename.

    So:

    <condition attribute="record1objecttypecodename" operator="like" value="User%" />

    rather than:

    <condition attribute="record1objecttypecode" operator="eq" value="8" />

    Hope this helps,

    Scott

  • Vassil Profile Picture
    Vassil on at
    RE: ObjectTypeCodes for custom entities different in UAT environment

    Until now we havent made any manual changes. We just have Type (From) = User in the filter for the view.

  • ScottDurow Profile Picture
    ScottDurow 50,166 on at
    RE: ObjectTypeCodes for custom entities different in UAT environment

    Solution elements don't normally have dependencies on the typecode - have you manually created some fetchxml that uses it and added it to a View?

    If so - then yes you'll need to manually edit the solution before deploying.

  • Vassil Profile Picture
    Vassil on at
    RE: ObjectTypeCodes for custom entities different in UAT environment

    Hi Scott,

    Do we need to edit the solution XML manually for the given view or there's some trick in the UI?

    Thanks,

    Vassil

  • Suggested answer
    RE: ObjectTypeCodes for custom entities different in UAT environment

    Hello Vassil,

    Scott is perfectly right...!

        We had faced the same issue with custom entity type code ...After deployment in UAT environment it has taken next sequential typecode.So we used typename instead of typecode of custom entities and problem solved.

  • Suggested answer
    ScottDurow Profile Picture
    ScottDurow 50,166 on at
    RE: ObjectTypeCodes for custom entities different in UAT environment

    ObjectTypeCodes are not guaranteed to be the same in all environments - you should use logical name instead to perform lookups. If you are filtering using the associatedobjecttypecode for connections - then you'll need to first perform a metadata lookup to get the entitytypecode for the target entity using it's logical name.

    Hope this helps,

    Scott

Helpful resources

Quick Links

Replay now available! Dynamics 365 Community Call (CRM Edition)

Catch up on the first D365 Community Call held on 7/10

Community Spotlight of the Month

Kudos to Saurav Dhyani!

Congratulations to the June Top 10 community leaders!

These stars go above and beyond . . .

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 287,986 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,588 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans