I have a batch class that inserts Account_Skill__c
records. To ensure I don't have duplicate account skills, I created a unique field called Unique_Account_Skill__c
and use Workflow to populate that field using the Account__c + ':' + Skill__c
formula.
For some reason, some of my batches fail with this error:
First error: Insert failed. First exception on row 45; first error: DUPLICATE_VALUE, duplicate value found: Unique_Account_Skill__c duplicates value on record with...
Without any other reasonable way to tracking down where the duplicates are, I turn off the Workflow, and allow the "duplicates" to be inserted. I then export that data and analyze in Excel. As it turns out, there are no duplicates.
Why would the system raise errors in my batch class, stating duplicates exist, but when I export the raw data, there are no duplicates?