web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested Answer

XRM Changing custom entity OwnerIdtype

(0) ShareShare
ReportReport
Posted on by 188

     We have a Custom Entity that we are generating via an app using the SDK.  The entity has 2 different owners.  OwnerId , Which is designed in the system to be referred to the Team and an pc_targetownerindividual which is intended to be the user. In the app I'm showing where the IndividualOwnerId is being mapped correctly but I actually don't see OwnerId being mapped at all. I believe this is resulting in the ownerId being defaulted to the User. However, when I added the field to be mapped it generates an error when trying to generate due to having an incorrect OwnerIdType. Which makes sense, it needs to know that it needs to be a 9 instead of an 8. However, I don't see anywhere to set the type code as the OwnerIdType isn't available in the Xrm.cs. I do see where 10018 is referenced but it is an entity type not an owner type. Does anyone have any information that might can help me understand what I'm doing wrong?

7026.Capture1.JPG

8360.Capture2.JPG8078.Capture3.JPG6242.error.JPG

I have the same question (0)
  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    You have an error in code shown on the following screenshot:

    WrongCode.png

    You assign to OwnerId entity reference that doesn't contain user or team logical name and guid of account as far as I can see.

    Fix it and error should go away.

    Good luck.

  • Jerett Crumbley Profile Picture
    188 on at

    My Apologies I should have eleborated that the SalesCenterId is in reference to the TeamId. It should be no different than the BranchId above it which maps to the team as well.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Then change mentioned line to

    OwnerId = new EntityReference("team", AcctTaget.SalesCenterId)

  • Suggested answer
    Jerett Crumbley Profile Picture
    188 on at

    This worked... I wonder how the Branch Id is any different being that references the same entity.

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Branch Id is the custom field and there is only 1 option available so there is even no need to populate the schema name. For multi entity enabled fields like owner, customer or regarding it's required to provide proper schema name of the record selected in lookup.

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 137 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 57

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 50 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans