function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
leadliaisonleadliaison 

API Error

Hello,

We are getting the error below when making the API call below. This seems to be happening because of the built-in dedupe logic in Salesforce.com (see screenshot). Can anyone tell me why the deduplicate logic is causing this API error? The lead/contact did not previously exist. 

API Error:
stdClass Object
(
    [errors] => stdClass Object
        (
            [fields] =>
            [message] => You are possibly creating a duplicate record. Please see Mike to verify lead status.
            [statusCode] => UNKNOWN_EXCEPTION
        )

    [id] =>
    [success] =>
)
 
Here is the call we are sending to the SFDC API:
 
$crmConn = new SforcePartnerClient ();
$this->crmConn->create ( $sObjects, 'Lead' );
 
Where the $sObjects we used was as following:
 
Array
(
    [0] => SObject Object
        (
            [type] => Lead
            [fields] => Array
                (
                    [Phone] => 207-588-1019
                    [FirstName] => Patti
                    [LastName] => Sutter
                    [Email] => psutter@mainetechnology.org
                    [Company] => Maine Technology Institute
                    [Country] => United States
                    [City] => Brunswick
                    [State] => Maine
                    [PostalCode] => 04011
                    [LeadSource] => Organic Search (SEO)
                    [Leadliaison__LLLastSearchEngine__c] => google
                    [Leadliaison__LLLeadLiaisonGrade__c] => C
                    [Leadliaison__LLLeadLiaisonScore__c] => 68
                    [OwnerId] => 00561000000vDYfAAM
                )
        )
 
)

Here are the duplicate lead settings in the instance:
Dedupe Settings
Matt SmelserMatt Smelser
The reason you are getting this error is the Duplicate Lead rule is set to "Block" if the record is already created. Try changing the lead's email, Name and Company to get around this error each time you insert a record.
leadliaisonleadliaison
Hi Matt & All,

Makes sense and we thought the same thing; however, there was no email for this person as Salesforce.com Lead. Would the Duplicate Lead Rule block/deny the API call for another record even if the emails were not the same? The odd thing is that we manually created the Lead in Salesforce.com, using the same informaiton, and this was not blocked. 

It would be great to understand the exact rules of the Duplicate Rule, and to know when it triggers. 
Matt SmelserMatt Smelser
leadliaisonleadliaison
Hi Matt - Super helpful, thank you!