You need to sign in to do that
Don't have an account?
durgaprasad vdp
how to transfer records one batch class to another batch class
how to transfer records from one batch class to another batch class
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Please check with below example which copies data from login history object to custom login history object.
You have to create a batch job with a scope of records from LoginHistory in the start method of your batch job. The trick here potentially is checking for duplicate records, e.g. LoginHistory records that may or may not already exist in the LoginHistory custom object.
Next, your execute method would create a new list of custom LoginHistory records and then insert them. Note that the max batch size is 200 records, so that means your batch job will run in "chunks" of 200 records at a time, but for simply copying from one object to another, you should have no problem with that.
To run the batch job on a regular basis, you'll want to call it from a Schedulable class. See here for more info on that:
http:// http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm (http:// http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm) For more information check with below link.
- http://salesforce.stackexchange.com/questions/66754/apex-batch-to-transfer-and-delete-data
Please mark this as solved if the information helps.Best Regards,
Nagendra.
Can you please explain your requirment. why you want to do this.
Regards
Mukesh
You should follow this code for transfer records one batch class to another batch class
First batch class:
Second batch class:
I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.
Thanks,
Ajay Dubedi