Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Duplicate owner for record

Posted on by 140

One of our users has a duplicate record in the owner table.  I had not known about the existence of this entity that links records to their owner until I was troubleshooting a SQL query that was returning a wrong result.  It used the owner entity as a join and was therefore counting records owned by this user twice.

I want to delete the duplicate owner record, but am concerned that it may impact the user.  Has anyone come across this situation before and can advise? Any ideas how a user could become duplicated as an owner?

Many thanks,

Rob

*This post is locked for comments

  • Rob Pearce Profile Picture
    Rob Pearce 140 on at
    RE: Duplicate owner for record

    I found the issue - the user had a duplicate user record that was disabled and so we did not see it initially.  Since I can't delete the disabled user record, we changed the sql join to the user table  and excluded disabled user records.  This will work as long as we do not use teams.

    The old sql join used the query:  select * FROM OwnerBase

    Thanks for your help solving this!

  • ashlega Profile Picture
    ashlega 34,475 on at
    RE: Duplicate owner for record

    Hi Rob

    If you posted the query, we might be able to help you find the problem..

  • Verified answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Duplicate owner for record

    Hi Rob,

    Owning user and Owning team are internally used by CRM.

    Basically Owner can be either a systemuser or a team. So when it is a systemuser the owninguser get populated and when it is team the owningteam get populated. You need to worry about these two fields.

    Owner type is a multi-entity type which accept both Systemuser and team lookup.

    So I dont think you have any duplicates - its is CRM behaviour.

    Thanks,

    Prateek

  • Rob Pearce Profile Picture
    Rob Pearce 140 on at
    RE: Duplicate owner for record

    There are system fields called owninguser and ownerid (also field for owning team).  There are corresponding system n:1 relationships called lead_owning_user (primary entity = User) and owner_leads (primary entity = Owner).  This is all OOB, none of it is custom.  

    It is the same set up for all the core records I checked:  leads, contacts, opportunities and cases.  Since we have never implemented cases, I am sure that this is not custom.

    This led me to the deduction that there is a system linking entity called Owner.  That was also the name of the table where we found the duplicate record.  There was no duplicate user record.

  • Aric Levin Profile Picture
    Aric Levin 30,188 on at
    RE: Duplicate owner for record

    Are you talking about a custom entity or the owner field in a regular entity which can be either team or system user?

    It seems like this might be a custom entity, since system users or teams will not have duplicate records.

    If this is a custom entity, you will need to re-map the records that are using that duplicate lookup to the original lookup, and then you should be able to delete the duplicate.

    I would first deactivate it, just to prevent orphaned records.

  • Suggested answer
    prt33k Profile Picture
    prt33k 6,907 on at
    RE: Duplicate owner for record

    Hi Rob,

    I believe you are talking about a custom field called as owner in your entity which you feel is duplicate to the Out-of-Box Owner field.

    Please recheck by going through customization of entity and see the schema name of both the field -one should be onwerid and other should be xxx_owner like.

    As per my understanding, since there was a custom ownership created there might be some business logic written for that so you do need to check the dependency in plugin/workflow/JS etc if that custom ownership field is being used or not.

    Also make sure that both owner are actually having same value and only then proceed with deletion of that field.

    Deleting the custom filed will not impact ownership unless there is custom code written for it.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans