0

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.

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.

  • 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 at 10:55
1

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.

  • 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 at 10:54

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.