1

I'm using JSforce to integrate Salesforce into my app. When I update a Salesforce account from my end via JSforce update function, it got DUPLICATES_DETECTED error because Salesforce considers this account is duplicate with another one. Although I set Allow in Duplicate rule setting of the Salesforce page and we can edit successfully this account on it, It cannot be done via API (with using JSforce) from my end because of this error. Is this possible to bypass Duplicate Management via JSforce without disabling these rules?

   const jsforce = require('jsforce');

   /* Update to Salesforce */
   update: function (updateObject, callback) {
     this.getSObject().update(updateObject, callback);
   }

Here is my setting on Salesforce Duplicate Rules section enter image description here

Some documents suggest setting allowSave to true in header of request via API soap like this but I don't use API soap, I'm using JSforce instead.

1 Answer 1

0

Since you have enabled Alert, you are getting the DUPLICATES_DETECTED message. The Allow option means that when the user sees the alert, they are also given the option to continue and create the record anyway.

EDIT: To use the Allow option for SOAP calls, you should use the allowSave option in DuplicateRuleHeader. For Apex, use DMLOptionsHeader.

2
  • Thanks, your opinion helps me a lot. I just wonder why Salesforce has an option allowSave in DuplicateRuleHeader in this document here Does this doc use for people who work with SOAP API directly to integrate with SF? I just confuse how they implement via SOAP API directly. Btw, I'm using js instead of java.
    – Tan Vo
    Aug 8, 2020 at 8:48
  • Ah that is new to me, that should work, but I'm not familiar with making SOAP calls. Please edit your post to include your SOAP call detail and how you are using DuplicateRuleHeader. Aug 8, 2020 at 15:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.