Mautic Community Forums

Duplicate Leads in CRM (Salesforce)

Quick shout out to the Mautic team: this software is awesome, love it!



Question: we’ve setup the Salesforce integration and can successfully push leads to Salesforce through Campaign actions. However, every time we push a lead with new info, instead of updating the existing lead, a new lead is created in Salesforce. Our understanding is that this is not correct. Mautic should be able to identify that the leads exists via the unique identifier (email address), preventing duplication.



Taking a look at the code base in GitHub, it appears that there is code to prevent duplication for the Zoho API: https://github.com/mautic/mautic/blob/e146b2eb2a2a153c0097e7ab8bdce201fb5f24ce/plugins/MauticCrmBundle/Api/ZohoApi.php



/**

Quick shout out to the Mautic team: this software is awesome, love it!

Question: we’ve setup the Salesforce integration and can successfully push leads to Salesforce through Campaign actions. However, every time we push a lead with new info, instead of updating the existing lead, a new lead is created in Salesforce. Our understanding is that this is not correct. Mautic should be able to identify that the leads exists via the unique identifier (email address), preventing duplication.

Taking a look at the code base in GitHub, it appears that there is code to prevent duplication for the Zoho API: https://github.com/mautic/mautic/blob/e146b2eb2a2a153c0097e7ab8bdce201fb5f24ce/plugins/MauticCrmBundle/Api/ZohoApi.php

/**
* @param $data
*
* @return array
*/
public function createLead ($data)
{
$parameters = array(
‘xmlData’ => $data,
‘duplicateCheck’ => 2 //update if exists
);
return $this->request(‘insertRecords’, $parameters, ‘POST’);
}

However, I don’t see this code in the Salesforce API: https://github.com/mautic/mautic/blob/e146b2eb2a2a153c0097e7ab8bdce201fb5f24ce/plugins/MauticCrmBundle/Api/SalesforceApi.php

Nor is it in the Salesforce Integration bundle: https://github.com/mautic/mautic/blob/e146b2eb2a2a153c0097e7ab8bdce201fb5f24ce/plugins/MauticCrmBundle/Integration/SalesforceIntegration.php

Is this an error? Shouldn’t there be the same duplicate check code in the Salesforce API and/or integration?