D365 Sales: Duplicate Detection Errors During Integration

When syncing records from an external system (such as NAV, Business Central, Salesforce, or HubSpot) into Dynamics 365 Sales, you may encounter errors that prevent records from being created. One of the most common causes is Duplicate Detection - a built-in D365 Sales feature designed to prevent the same record from being entered twice.

While duplicate detection is useful for maintaining data quality, it can cause integration failures when legitimate records are incorrectly flagged as duplicates. This article explains how duplicate detection works, which record types are affected, and how to resolve the issue.

The Error

The integration will log an error similar to the following:

E2180 - ECE_RestFaultResponse: Status 400 Bad Request — "An account with the same name or account number already exists in the system." (0x80040265)


This error is returned by D365 Sales - not the source system - and it means the record was rejected before it was created.

How Duplicate Detection Works


Duplicate Detection Rules in D365 Sales define which fields are checked when a new record is created or updated. If an incoming record matches an existing one based on those fields, D365 blocks the operation and returns the error above.

Rules can be configured with AND or OR logic between conditions:

•       OR logic — blocks the record if any one of the conditions matches (e.g. same name OR same number). This is the default and the most common cause of false positives.

•       AND logic — only blocks the record if all conditions match simultaneously (e.g. same name AND same number). This is more precise and recommended for integrations.

Root Cause

The most common root cause is the OR logic in the duplicate detection rule combined with data that is legitimately repeated across entities or regions. For example:

•       A company called "Acme Corp" exists in both the US and MX entities in NAV/BC with different customer numbers. D365 blocks the second one because the name matches, even though the account number is unique.

•       A contact with a shared corporate email address (e.g. info@company.com) is associated with two different companies. D365 blocks the second contact because the email matches.

Fix Options

There are three ways to resolve this issue, depending on your situation:

 

Option 1 — Change OR to AND in the Duplicate Detection Rule (Recommended)

This is the cleanest and most sustainable fix. Update the rule so that it only blocks a record when all conditions match — meaning it is a true duplicate, not just a partial match.


When to use this option:

•       You have multiple source entities or regions that can legitimately share names or email addresses.

•       Your source system has a reliable unique identifier (e.g. customer number, account number) that distinguishes records.

How to apply:

1.     In D365 Sales, go to the gear icon → Advanced Settings.

2.     Navigate to Settings → Data Management → Duplicate Detection Rules.

3.     Find and open the rule for the affected record type (Account, Contact, or Lead).

4.     Click Deactivate — the rule must be inactive to edit it.

5.     Change the condition logic from OR to AND between the name/email and number/ID fields.

Click Save, then Publish to reactivate the rule.

Option 2 — Deactivate the Duplicate Detection Rule Entirely

If duplicate detection is not required for a specific entity in your D365 environment, the rule can simply be deactivated.

 

When to use this option:

•       Duplicate detection for this entity is not a business requirement

•       Data governance is handled entirely by the source ERP system

After Applying the Fix

Once the duplicate detection rule has been updated or suppressed, re-run the failed integration transfer. The previously rejected records should now be created successfully in D365 Sales.