3

I'm running some AMPScrip in a Landing Page (in CloudPages). At one stage, I need to update a single Salesforce Object (Lead) with new information I got from a form.

I am using the Call Below:

SET @ResultUpdate = UpdateSingleSalesforceObject(
    'lead', 
    @LeadID,
    'FirstName', @FirstName,
    'LastName', @LastName, 
    'email', @Email, 
    'Phone', @Phone,
    'Company', @Company , 
    'LeadSource', 'Campaign',
    'Status', 'Open'
)

But it is not working. I wrapped the AMPScript in Server Side Javascript to get a more descriptive error and here is what I received back:

{"message":"Call to update the salesforceobject lead ID = 00Q2E00001sYFGrUAO failed! Error status code: DUPLICATES_DETECTED\nError message: Use one of these records?","description":"ExactTarget.OMM.FunctionExecutionException: Call to update the salesforceobject lead ID = 00Q2E00001sYFGrUAO failed! Error status code: DUPLICATES_DETECTED\nError message: Use one of these records?\r\n Error Code: UPDATESINGLESFOJBECT_FUNC_ERROR\r\n - from Jint\r\n\r\n"} 

The error message says it is a duplicate record. Does anybody have any idea of why the UpdateSingleSalesforceObject call would check for duplicates?

Thanks,

2
  • 1
    You may like to verify if there are Duplicate Rules setup on the Lead in your integrated Salesforce Account and that if those are fired on any update operation as well. Any call to update the record within the Salesforce will go through the duplicate checks if configured and if there are no rules to bypass one. This seems to be most likely that case where on calling the update, the logic identifies an existing Lead and thus the update fails.
    – Jayant Das
    Commented Dec 12, 2018 at 22:08
  • Thanks for the prompt response. It looks like that was the issue, we will review the duplicate rules. Commented Dec 12, 2018 at 22:26

2 Answers 2

1

Looks like the new information you're updating back(FirstName,LastName,Email etc..) to salesforce is matching with some of the existing data which is triggering a duplicate rule. You might want to look at duplicate rules on the lead object to verify this.

Usually from apex or api you set the dml.DuplicateRuleHeader.allowSave = true; to bypass these rules, but not sure of how you can handle it from marketing cloud end.

1
  • 1
    Thanks a lot for the prompt response. That was definitely the bottom of the issue - We will review the rules set in Salesforce. Commented Dec 12, 2018 at 22:32
2

The new information you're updating back(FirstName,LastName,Email etc..) to salesforce is matching with some of the existing data which is triggering a duplicate rule. You might want to look at duplicate rules on the lead object to verify this.

So goto Setup --> Duplicate Rules --> Standard Contact Duplicate Rule (LINK) --> Edit --> Action --> De select Alert Checkbox. and save it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .