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

How to get 1:N relationtishps without knowing the entity logical name and the logical name of the lookup field?

(1) ShareShare
ReportReport
Posted on by 15

Hello

I have duplicated records from an entity called "Ville/City" and I want to merge them, I know there is a feature in dynamic CRM to merge duplicates but the problem is that it doesn't work for custom entities (at least this is what I know from my research)

so I need to delete the duplicated records from a batch program but to delete the said records I need first to reassociate all the relationships of all those records to a master record before deleting the other duplicate (doing the work manually from a program)

I already have a program that gets the GUID of duplicated records grouped together, the question is there a way to update the related records faster without having to write the logical name of each related entity and also the logical name of the lookup field to update?

This is the image of the entity "Ville" and its 1:N relationships (as you can see there is many so I want to know if there is a way to quickly update all these relationships) 

5037.Screenshot_5F00_6.png

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

    Hello,

    I might recommend an easier workaround - find those relationships and change the behavior from Referential - Restrict Delete to Referential - Remove Link.

    pastedimage1666096042827v1.png

  • Aimad q Profile Picture
    15 on at

    Thank you for the recommendation.

    but if I used  "Remove Link" it will just be the same! It will remove the duplicated records and the link between the record "Ville/City" and its related entities but I still need to update the related records and assign them to the master record (the original record that will not be deleted)

    or maybe I didn't understand something?

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

    Ahh. I understood you the wrong way. I thought you experience issues with the deletion of referenced records. Early morning here so I'm sorry for that.

    I'm afraid you will have to do that in 3 steps:

    1. Collect and analyze the existing data to find duplicates and decide what is the master record and what is a duplicate.

    2. Query all the data that references duplicates and update it with the corresponding master record.

    3. Delete records that are considered duplicates.

  • Aimad q Profile Picture
    15 on at

    No problem man.

    well, I think there is no other solution than that I was trying to find a quick way to other the 2 steps without manually writing the entity name and the field to be updated but it seems there is no other way.

    Thanks.

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

    If my reply (or replies) answers your question take a minute and verify the answer. You can do it by clicking "Yes" at the top of the reply (or replies) under the label "Does this answer your question?"

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 146 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 59

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans