I was searching the web for information on how to modify the columns shown in the Potential Duplicates Component, but didn’t find much useful information. Mathias Del Maso finally found out how to do it, so I thought to share this. Thanks, Mathias, for bringing this to my attention.
Out of the box, Salesforce provides your Org with Duplicate Management rules to make sure you aren’t creating duplicate leads, contacts, and/or accounts.
Of course, you can add your own matching rules, but it’s also important that your users see the right fields to actually identify if we are talking about a real duplicate record or not.
In the following scenario, I’m creating a Lead with a different first name but the same last name and email as an already existing Contact in the database. The duplicate management rules detected a potential duplicate and showed me this in the sidebar component:
By clicking the “View Duplicates” link in the component, I get the following information and columns of the current lead and the potential duplicate contact:
How to modify the Potential Duplicates Component results columns?
But let’s say I wanted to add the Postal code of the contact as extra information, and I would like the email address to be shown as a second column. How and where can I change this?
Well, in Lightning Experience, this layout follows the same format as the ‘Search Results’ of the Search Layouts section of the object, in this case, Contact.
To change it, navigate to Setup—Object Manager—Contact—Search Layouts and edit the ‘Search Results’ section. I’ll add the Postal code and also re-order so that email comes second:
Let’s check what this did to our Potential Duplicates Results window:
We can now see that email is the second column and that we added the Postal code as the fourth column.
Be aware, though, that the Search Results layout has an impact in other places also (in contrast to Salesforce Classic, which lets you adapt different layouts individually, like Lookup Dialog results, etc…), so choose your fields and order carefully!
In Lightning, the Search Results impact:
Global Search Results columns:
Lookup Dialogue Search Results:
This is the layout you’ll get when populating a lookup for that object, entering a keyword, and hitting enter. For example, I’m searching to relate a primary contact to a quote:
I hope this clearly explains how to adapt the Potential Duplicates Results Component Columns!