Hello,
I have account survey data that i am storing in a custom entity that has 1:M relationship with account. In the account survey custom entity, i have created a lookup to account name, that pulls the parent account name. I should only store survey for those account records that exists in CRM. If i import the survey data using excel import, the second time onward the import creates duplicate records in account survey custom entity, i would have to make the second import to update the existing account survey record rather than inserting a new one. any idea? Actually, i have to make the account survey custom entity as just 1 to 1 rather than 1 to M with parent account record. Please share your thoughts. Thanks!
Hi partner,
There are three ways for you to do this.
1. Use Duplicate Detection Rules
Dynamics 365 has an OOB function to check the duplicate data named "Duplicate Detection Rules". Go to Settings->Data Management->Duplicate Detection Rules and create a new record.
(In my case, I have a look up field related to entityB on entity A, so I add a duplicate rule on the "B" field and then I tried to import a data with a existing B record to entity A, and the record has updated succesfully instead of creating a new one)
Save and publish it and then you could try to import your data now.
2. Develop a plug-in with C# at the pre-create event of your custom entity and judge if the account has existed in your custom entity.
docs.microsoft.com/.../run-duplicate-detection
3. Use Dynamics 365 web api to control the duplicate rules.
docs.microsoft.com/.../manage-duplicate-detection-create-update
Hope it helps.
Best Regards,
Leo
Hi partner,
When importing data via the Import Data Wizard, you should need to choose whether to allow duplicate records.
It defaults to No, so no duplicate data is imported.
Please refer to the following blogs about importing data:
https://www.encorebusiness.com/blog/how-to-use-import-in-dynamics-365-customer-engagement/
------------------------------------------------
In addition, to achieve a 1:1 relationship between account survey custom entity and parent account, you could create duplicate detection rules for the parent account name field of the account survey.
In this case, it is guaranteed that the account survey has no duplicate parent accounts and has the same effect as the 1:1 relationship.
Please refer to the following bloggers about duplicate detection rules:
https://rocketcrm.co.uk/dynamics-365-duplicate-detection-rules/
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156