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)

ObjectTypeCodes for custom entities different in UAT environment

(0) ShareShare
ReportReport
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

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    ScottDurow Profile Picture
    21 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

  • Suggested answer
    Yashpal Rajput Profile Picture
    on at
    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.

  • Vassil Profile Picture
    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

  • ScottDurow Profile Picture
    21 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
    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.

  • Suggested answer
    ScottDurow Profile Picture
    21 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

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
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans