I was searching the web on how to modify the columns shown in the Potential Duplicates Lightning Component but didn’t find too 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 Firstname, but the same Lastname and email as an already existing Contact in the database, and the duplicate management rules detected a potential duplicate and shows 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 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 fourth column.
Be aware tough, that the Search Results layout has an impact in other places also (in opposite to Salesforce Classic which lets you adapt different layouts individually like Lookup Dialog results, etc…), so chose your fields and order carefully!
In Lightning the Search Results impacts:
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 on a quote:
I hope this clearly explained how to adapt the Potential Duplicates Results Component Columns!