3

In my org I wanted to see potential duplicates contacts on contact record page itself.

We are using Lightning Experience, so setup matching rules and added potential Duplicates showing section on UI of contact. But my matching rule is not getting activated.

Error over mail

we can't activate the rule because it defines an unusually large number of records as possible duplicates.

Matching Rule criteria

(Contact: FirstNameFUZZY: FIRST NAMEMatchBlank = FALSE) AND (Contact: LastNameFUZZY: LAST NAMEMatchBlank = FALSE)

I understand that I need to add more fields to the matching criteria to make it work, But I can't since this is the criteria I want for considering duplicates.

Is there any way this can be achieved? Any free app that shows potential duplicates in record page itself, like standard salesforce duplicate functionality shows?

Eg. for understanding

I have 6 contacts with names matching exactly and company is null and email is different on all contacts. BUT all these are duplicate (business perspective). So is there any rule criteria or app that can show me all these duplicate contacts on details page of contact record.

Thanks for your valuable time and suggestion.. :)

5
  • 1
    Have you tried implementing a Visualforce page? I would use a query to pull the records based on the criteria you mentioned, get the current contact record id using: WHERE Id = :ApexPages.currentPage().getParameters().get('id') and have this on the contact detail page layout.
    – Arnold Jr.
    Jan 30, 2018 at 19:26
  • While I think what @ArnoldJr. suggests is the best plan, if you have any significant volume of Contact records, it is unlikely that a Salesforce native solution will work well. You would need to go for something run locally like DemandTools to match on criteria that are that broad.
    – David Reed
    Jan 30, 2018 at 20:26
  • Thanks a lot for response @ArnoldJr & David Yes we have large number of contacts in org, and yes we are using Demand tools for this requirement as of now. But i wanted to see potential duplicates in same record layout. And not open another tab or app to see potential duplicates. Also do you what is the limit of duplicate records for native duplication rules? About VF solution that would be my last resort...I still think there can be workaround for this problem (w/o code) Jan 31, 2018 at 8:47
  • @Dnyaneshwar, I think the problem is that your matching rule is so broad that it cannot be run with good performance within the platform. I doubt you're going to find a workaround other than making your rule stricter.
    – David Reed
    Feb 1, 2018 at 14:33
  • Yeah i am also thinking same....But other solution that could work is any app that shows potential duplicates on the record page itself. like salesforce standard duplication section shows on record itself. Feb 1, 2018 at 14:59

1 Answer 1

4
+50

Well, given that Salesforce has already stated that they cannot activate the matching rule, that means you have to resort to your own programmatic solutions.

I'm not sure if there is any AppExchange app that may resolve your use case, but there are some classics like DupeCatcher, for example.

Assuming apps like DupeCatcher don't solve your problem, I think your best bet is to go for a Lightning Component, even better than an actual Visualforce.

If you design it well, you can have a Flexipage embeddable Lightning Component which detects the duplicates of the given record on the fly, just like the standard one.

Some suggestions I would make would be to:

  1. Read the matching criteria from a Custom Metadata, as well as the SObject you want to check the duplicates from.
  2. Make the Apex Controller dynamic, that is using dynamic SOQL and the SObject's inherent polymorphism.

With those to things you'll be able to utilize your component not just for contacts but also for leads, accounts or any other objects you want to use.

Also take into account, the possibility of a record having 10+ duplicates and make the component able to handle many records (infinite scroll? pagination?).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .