You need to sign in to do that
Don't have an account?
Von V.
Is it possible to have Batch Apex that will find duplicates and without hitting SOQL Governor Limit?
I'm curious if it is possible to have Batch Apex which will be able to find duplicate records within same Object and Cross-Object. Example duplicate emails.
There were five records run by batch, on the Second Run of batch there was a duplicate email found in Fist Run which is test5@email.com.
I would like to know if is is possible to find duplicates in Batch Apex? Also, Is it possible that the SOQL query will be used will not hit SQL limit?
First Run Second Run
- test1@email.com - test11@email.com
- test2@email.com - test12@email.com
- test3@email.com - test5@email.com
- test4@email.com - test13@email.com
- test5@email.com - test14@email.com
Thanks.
There were five records run by batch, on the Second Run of batch there was a duplicate email found in Fist Run which is test5@email.com.
I would like to know if is is possible to find duplicates in Batch Apex? Also, Is it possible that the SOQL query will be used will not hit SQL limit?
First Run Second Run
- test1@email.com - test11@email.com
- test2@email.com - test12@email.com
- test3@email.com - test5@email.com
- test4@email.com - test13@email.com
- test5@email.com - test14@email.com
Thanks.
The batch class runs in transactions of up to 2000 records, depending on what you use for your batch size. From there you can query based on your duplicate logic, and then handle duplicates appropriately (either merge or delete them). So yes, you should be able to find your duplicates and avoid governor limits with a batch apex approach.