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
sultansultan 

Tell me the code anybody how to avoid duplicate records through batch apex?

Best Answer chosen by sultan
Ana Catarina BritesAna Catarina Brites
Hello Raju, 

Try using a Set<> of recods instead of a List<>.
In the set if a duplicated record shows up it will not be added to the list. 

Hope this helps. 

Ana Catarina Brites

All Answers

Ana Catarina BritesAna Catarina Brites
Hello Raju, 

Try using a Set<> of recods instead of a List<>.
In the set if a duplicated record shows up it will not be added to the list. 

Hope this helps. 

Ana Catarina Brites
This was selected as the best answer
sultansultan
Hi Ana catarina Brites,

Thanks for your  answer.....