+ Start a Discussion
Mahesh K 22Mahesh K 22 

Why dont we call future methods in batch class its very urgent

Hi to All,
         
          I would like to know Why dont we call future methods in batch class 
          Give me exaplanation and one example .
            Plz guys  
Pankaj PPankaj P
Hi Mahesh,
Future methods runs asynchronously and same is for Batch class which also runs asynchronously. As per Salesforce limitations "Future method cannot be called from a future method". 

For understanding why with an example please read here (https://developer.salesforce.com/forums/?id=906F0000000AqdVIAS) and here (https://developer.salesforce.com/forums/?id=906F00000008qa4IAA)
For more information about Future methods and their behaviour please read here (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_invoking_future_methods.htm).

Thanks,
Pankaj.