Loading

Salesforce Error 'Duplicate value found: uuid__c duplicates value on record with id: 00XXXXXXXXXXXXX' on Patch Operation

Date de publication: Jun 19, 2026
Description

When sending continuous REST API PATCH calls to Salesforce using external ID fields (such as uuid__c) that accept only unique values, you may encounter the following error:
"duplicate value found: uuid__c duplicates value on record with id: 00XXXXXXXXXXXXX"
This error occurs even though a PATCH operation is designed to either update an existing record or insert a new one (upsert behavior). The duplicate error appears because of simultaneous or near-simultaneous requests.

Why does this happen?
When multiple requests are sent in rapid succession — for example from Node.js or JavaScript — there is a risk of overlapping requests. If the same record is submitted twice within milliseconds or seconds, the first request may still be in process when the second one arrives. The Salesforce server then identifies the second request as a duplicate and throws the error.

Résolution

To resolve the duplicate error on PATCH operations, synchronize your REST API requests so that only one request for a given record is in flight at a time.

Best Practices for Synchronizing Requests

  • Send one record per request or batch: Ensure that each batch does not contain the same record more than once.
  • Add a time gap between duplicate record requests: Although Salesforce does not enforce a mandatory delay between consecutive requests, it is good practice to introduce a few seconds between requests for the same record to prevent overlap.
  • Queue requests sequentially: If using an event-driven language like Node.js, use async/await patterns or a queue mechanism to serialize requests for the same external ID.
Numéro d’article de la base de connaissances

000383480

 
Chargement
Salesforce Help | Article