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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Duplicate Detection wi...
Power Apps
Unanswered

Duplicate Detection with custom JavaScript

(0) ShareShare
ReportReport
Posted on by 33

After analyzing the default function of Microsoft Sales Hub Lead's 'Qualify' Main Form ribbon button, we wanted to create a custom action with similar functionality. This includes creating records and running built in Duplicate Detection.

nandrews_0-1657124742991.png

 

nandrews_1-1657125221172.png

 

Neither JavaScript nor C# Plugins seem to support running built in Duplicate Detection for record creation or modification when searched online or in Microsoft documentation - but I hope I am wrong!

If anyone has insight as to a way to do this or how to mirror the ribbon actions in Sales Hub, it would be much appreciated.

(Also, They do seem to use JavaScript to some degree: )

nandrews_3-1657125657270.png

 

I have the same question (0)
  • eleung83 Profile Picture
    232 on at

    Have you tried out the Duplicate Detection sdk message and web api actions available here:


    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/duplicate-detection-messages?view=op-9-1.

     

    Both these routes execute whatever duplicate detection rules that you would have setup in your environment.

  • nandrews Profile Picture
    33 on at

    @eleung83 Thank you for the tip! This could solve half the solution as the functionality we want both detects duplicates via duplicate detection rules and gives an interactive dialog to merge, ignore, or cancel the duplicate record.
    This is arguably the more important function of the two as it seems harder to replicate and would maintain a more uniform user experience.

  • eleung83 Profile Picture
    232 on at

    If you are also looking for a UI as well that I am guessing you'd want to give your users the ability to do what you mentioned, then I'd suggest also looking at the OOB duplicate detection forms (available once you've enabled an entity for duplicate detection, or if the entity you are looking at is already enabled for duplicate detection).

     

    These go hand in hand with the sdk messages and api requests for doing the actual duplicate detection, and can allow your users to merge and ignore the duplicate detection prompt

  • nandrews Profile Picture
    33 on at

    @eleung83 I have searched for these 'OOB duplicate detection forms' you mentioned and cannot find any information online or in Microsoft documentation.
    Would you be able to give any more info or maybe even an example of this UI? I may be searching in the wrong places.

  • cchannon Profile Picture
    4,702 Moderator on at

    For the UI portion, I would look at Custom Pages. They will allow you to build any custom UI you want and can easily be opened from a Command button as a dialog, side panel, or as full screen.

  • eleung83 Profile Picture
    232 on at

    It's the 2nd screenshot in your original post (The one with the title: "Account or contact may already exists"), This form is the one that appears whenever you create (and I think also when you update a record that has duplicate detection enabled, and one of the rules has caused duplicates to be found). It's essentially the result of when the Duplicate Detection sdk message and web api actions are executed, displayed in a UI format that unfortunately can't be customized (you would have to go your own way if you wanted to replace these forms, but I think you may have issues trying to stop these existing duplicate detection forms from automatically appearing).

     

    It's also from here that the user can either ignore and continue with creating/updating the duplicate record or choosing to merge the records together. More on the standard merging functionality here: "https://docs.microsoft.com/en-us/power-apps/user/merge-duplicate-records"

     

     

  • HS_Nico Profile Picture
    83 on at

    I'm facing the same problem. Have you already found a solution how to open the dialog box?

     

    I can detect duplicates with JavaScript and I can open dialog boxes. But I can't open the dialog to merge the records.

  • eleung83 Profile Picture
    232 on at

    You cannot open the out of the box merge dialog windows directly via javascript or any other supported method that I can think of. 

     

    If you really need to, then you could open the merge dialog page directly, as I think it's still hosted as an aspx page, but obviously this is unsupported and hence could fail at any time if the merge dialog functionality changes.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard