You need to sign in to do that
Don't have an account?
Passing variable from batch Apex to another batch Apex?
Hi All,
I have a requirement where I need to serialize batch apex.
I came across this link in cookbook: http://developer.force.com/cookbook/recipe/serialize-batch-apex
This is a good example but I have a concern regarding passing parameters in the batch apex.
In the example the queries in Start method are simple with Limit 1000. I have to query with where condition of ID. I wil get ID value in first batch apex but while calling second batch apex i wont get that ID as it will become null. How can i pass the ID from one batch apex to another? or is there any other method where we can keep that ID as global and use in batch apex?
If your following that Cookbook example, you can pass the parameter in the Email.
Then, in your Email Handler Service, retrieve the information from the body or subject line of the email.
Then, when you instantiate your Batch Apex in the Email Handler class, you can pass along your information to the Batch Apex class.
All Answers
If your following that Cookbook example, you can pass the parameter in the Email.
Then, in your Email Handler Service, retrieve the information from the body or subject line of the email.
Then, when you instantiate your Batch Apex in the Email Handler class, you can pass along your information to the Batch Apex class.
how about dumping the parameters to be passed into an object, or even a custom setting (saves you the soql), which is then stateful across batch invocations.
Hi Cory,
Can you please provide the sample code to pass the variables from one batch another through Email Handler class to Email Handler Service. I am also seeking for the same thing. Please help me out.
Thanks,
Lakshmi.