Known Issues and Workarounds

Here are some known issues learned while developing applications or customer projects. Hope you find these useful.

Feel free to add comment below if you would like to share known issues or workarounds you found and someone may benefit from it.

Duplicate Custom Setting (List type) record when concurrent requests are executed via APEX.


When a user attempts to create a record/row on a List type Custom Setting, it can cause duplicate records if the request is executed via APEX.

Error message:

FATAL_ERROR System.DmlException: Upsert failed. First exception on row 15; first error: DUPLICATE_VALUE, duplicate value found: <unknown> duplicates value on record with id: <unknown>: []

Workaround: Try to insert/upsert few records at a time, 5 records worked for us.


/* Upsert reocords in smaller batches as Custom setting records can not be inserted all at once

  causing duplicate value error.


public static void upsertRecordBatches(List<sObject> records,Integer batchSize) {

    Integer counter = 0;

    List<sObject> batchForUpsert = new List<sObject>();

    for (sObject aRecord: records) {


         counter += 1; //increment counter

         if (counter >= batchSize) {



              counter = 0;





        <classname>.upsertRecordBatches(dataMappings,5); Known Issues and Workarounds
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *