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
Nishad BashaNishad Basha 

How to Calling the Future method from Batch Class ?

can you please give me the examples of using future method from batch Apex class.please give some ideas.
Amit Chaudhary 8Amit Chaudhary 8
I think you cannt call future method from batch job.
FATAL ERROR: Future method cant be called from future or Batch

The maximum time out you can specify for a HTTP request is 120sec(default is 10), so you'll need to decide if the services that you are using are feasable to work in that time limit...You can always handle random api call time outs using try - catch block, but if you think that the service that you are using would almost for every call out need more time then I'm afraid you'll need to look for a better solution as Batch apex approach would not work in your case.

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_timeouts.htm

Please check below link
http://salesforce.stackexchange.com/questions/57154/calling-future-method-from-batch-class

If you want to call a batch job from another batch job then you need to call in finish method.

Please let us know if this will help you

THanks
Amit Chaudhary
 
Carolina Ruiz MedinaCarolina Ruiz Medina
Hi Nishad, 
I would like to ask you something, why would you like to call an @future method from a batch class? I'm just wonderin as you are already in a batch asynchronous process therefore you could do the processement there instead to call an @future class. 

Looking forward to hearing from you.

Thanks,
Carolina. 
Nishad BashaNishad Basha
Hi, Carolina Ruiz Medina

               can you please give me the example of above scenario.