function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Jha dilipJha dilip 

Bulk insertion of data using dataloader

Hi

i have written a validation rule through apex which prevents creation of duplicate records. this functionality is working fine for single records but when i insert duplicate bulk records through dataloader then it gets inserted. please suggest what can be the issue
logontokartiklogontokartik
Hi,
Can you post your validation rule so that we can verify. Thank you.
James LoghryJames Loghry
My guess is you're using addError in a trigger to prevent the duplicates.  There are gotchas you have to watch out for here.  For instance, if you call addError, it prevents additional execution of the trigger.  See this post for tips on successfully using addError: https://developer.salesforce.com/forums?id=906F00000008zMpIAI