1

I have NPSP v3 set up in Salesforce and am using the REST API to create a contact record. I am inserting fields [FirstName], [LastName], [Email], [Phone], [MailingState], [MailingPostalCode], [RecordTypeId] only.

It works fine but I have a case that is throwing the error

Error: call to URL https://axysau.my.salesforce.com/services/data/v20.0/sobjects/Contact/ failed with status 400, response [{"message":"Failed to create Account for Contact FIRSTNAME LASTNAME. You are creating a duplicate record. We recommend you use an existing record instead.","errorCode":"FIELD_CUSTOM_VALIDATION_EXCEPTION","fields":[]}], curl_error , curl_errno 0

It is failing for a case where the contact is already in Salesforce with a different email address. I have checked validation rules on Account, Contact and npsp__Address__c but none of them have any. I also checked 'Household Account Addresses Disabled' in NPSP Settings->People->Addresses. I still get the same error.

So I changed the postal code for that contact before its created with the API and it has successfully created the Contact & Account for them.

Where can I change settings so that contact with the same firstname, lastname & postal code as someone already in Salesforce doesn't block me from creating a new Contact & Account record for them? No doubt I will get the same people using a different email address, or different people with the same name living in the same suburb. I want it to create a new record in all cases.

2 Answers 2

2

This is caused by the Duplicate Rules feature. The error you're seeing is deceptive because the Duplicate Rule error is typically DUPLICATES_DETECTED, Use one of these records.

Check Setup to see if you have Duplicate Rules configured. If you have active rules that are set to Allow, then go to the NPSP Settings tab > System Tools > Error Notifications and check the Respect Duplicate Rule Settings.

1
  • Thank you! I've disabled the Duplicate Rule on the Account object and I can successfully add the record now. I'll see about re-activating it and modifying the rules.
    – Shane
    Oct 12, 2019 at 10:54
1

The problem is not Validation Rules but Duplicate Rules.

NPSP is trying to create a Household Account for each Contact you insert. However, the Account creation is being blocked by the Duplicate Rule on Account, likely meaning that you already have a Household Account by that name. You may wish to customize Duplicate Management to change the criteria used to identify duplicate records to be more rigorous, or even deactivate it entirely.

1
  • Thank you! I've disabled the Duplicate Rule on the Account object and I can successfully add the record now. I'll see about re-activating it and modifying the rules as you've specified.
    – Shane
    Oct 12, 2019 at 10:55

You must log in to answer this question.

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