You need to sign in to do that
Don't have an account?
sandip87
Mass record comparison in Salesforce using Batch Apex
Hi,
I am in a need to compare two objects having millions of records in both of them. Both objects have same fields and I need to compare for unique records; lets say for one field 'Amount', I need to take records one by one from Obj1 (will also contain millions of records) and need to compare it with the millions records of Obj2 in Amount fields. If there is a match, I need to do some field update on Obj2. Only SOQL query will not help me because it will hit govern limit of salesforce.
Is there any way to achieve this mass record comparison using Apex keeping code optimization, govern limit and time complexity in mind.
Thanks,
Sandip
I am in a need to compare two objects having millions of records in both of them. Both objects have same fields and I need to compare for unique records; lets say for one field 'Amount', I need to take records one by one from Obj1 (will also contain millions of records) and need to compare it with the millions records of Obj2 in Amount fields. If there is a match, I need to do some field update on Obj2. Only SOQL query will not help me because it will hit govern limit of salesforce.
Is there any way to achieve this mass record comparison using Apex keeping code optimization, govern limit and time complexity in mind.
Thanks,
Sandip
Thanks for the reply.
I have tried to use chaining of batch classes but it doesn't work. The problem is I can't call another batch class (say BatchClassB for Obj2) from START or EXECUTE method of BatchClassA (for Obj1). When I define the call of BatchClassB from BatchClassA's FINISH method, It is executing once only (i.e after processing all records of Obj1). I need something to call BatchClassB (where compression will be done) after taking one record from Obj1 using BatchClassA.
Have you any Idea on this or any other alternative you can suggest.
Thanks again !!
Sandip.