Duplicate rules on Lead or Contact fails to work when the Primary Compact Layout has Campaign field added
Last updated 2021-02-16 ·Reference W-6233335 ·Reported By 10 users
When Campaign fields are added to the compact layout of lead, FindDuplicatesAPI runs into an exception
1. Go to Setup->Customize->Lead->Compact layout
a. Create a new compact layout and add the field “Campaign” to the layout and save it.
b. Set this new compact layout as the primary layout
2. Make sure the standard Lead Matching Rule, Standard Contact Matching Rule and Standard Lead Duplicate Rule is active.
* This can be reproduced with any standard or custom lead rule
3. Create a lead and then a duplicate of this lead (making sure the standard fields like company, name, email, phone are populated).
* If the rule blocks your duplicate creation, set the rule to alert and not block.
4. Go to Developer Console-> Debug -> Open Execute Anonymous Window and paste the below code:
system.debug( Datacloud.FindDuplicates.findDuplicates([select id from Lead where id = ‘<replace with your duplicate lead id>’]));
Error seen : "Line: -1, Column: -1 System.HandledException: The list of results isn't the same size as the input list. Got: 1 , expected: 2. Contact Salesforce support.”
Use a standard Compact layout as the Primary Compact Layout
OR Use a custom compact layout without the Campaign field added
Is it Fixed?
Any unreleased services, features, statuses, or dates referenced in this or other public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make their purchase decisions based upon features that are currently available.