Hello Community Experts,
Is there any way where i can list all the duplicate records of a lead in a separate view?
I found OOB it is not possible, is it possible via code?
Please advise
Best Regards,
Sumaira Noor
Hello Community Experts,
Is there any way where i can list all the duplicate records of a lead in a separate view?
I found OOB it is not possible, is it possible via code?
Please advise
Best Regards,
Sumaira Noor
Thanks a lot for the response Nathan and Mehdi
Thank you for taking time to help me Mehdi. I tried the code and it shows the duplicates under subgrid.
Many thanks for it. I learned something new.
I will suggest this solution to my client. Hope she agrees for this.
Best Regards,
Sumaira Noor
Hi,
I replay your scenario using some unsupported code.
First, you need to add a subgrid to you form. I used Lead Entity as an example. I added the subgrid within a section wish is hidden by default.
Then you can add this JS function in onLoad event. This function inject dynamically a fetchXml to the subgrid. Basically, I retrieve leads with the same Topic, FirstName and LastName.
function getDuplicates(executionContext) { var formContext = executionContext.getFormContext(); if (formContext.ui.getFormType() != 1) { var duplicatesGridControl = formContext.getControl("Duplicates"); if (duplicatesGridControl == null) { setTimeout(getDuplicates, 2000); } else { var leadId = formContext.data.entity.getId().replace("{", "").replace("}", ""); var firstName = formContext.getAttribute('firstname').getValue(); var lastName = formContext.getAttribute('lastname').getValue(); var topic = formContext.getAttribute('subject').getValue(); var fetchData = { subject: topic, firstname: firstName, lastname: lastName, leadid: leadId }; var fetchXml = [ "", " ", " ", " ", " ", " ", " ", " ", " ", "", ].join(""); duplicatesGridControl.setFilterXml(fetchXml); duplicatesGridControl.refresh(); var summaryObj = formContext.ui.tabs.get("Summary"); var duplicatesObj = summaryObj.sections.get("Summary_Duplicates"); duplicatesObj.setVisible(true); } } }
Hope this helps, good luck :)
Hi Sumaira,
I'm afraid you won't be able to create a view to list the duplicate records, however you can review the duplicate records by running a Duplicate Detection Job -- https://docs.microsoft.com/en-us/power-platform/admin/run-bulk-system-jobs-detect-duplicate-records -- which will take into account the Duplicate Detection Rules you have in place.
You can always use SDK to retrieve the duplicate records as well, but that would involve more development effort than just running the Duplicate Detection Job.
I hope it helps.
Thanks,
Hi Sumarai please avoid to duplicate your threads.
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,269 Super User 2024 Season 2
Martin Dráb 230,198 Most Valuable Professional
nmaenpaa 101,156