답변 3개

Hi Anu,While @Future cannot be called from a batch class, a web service can. A web service can also call a @future method. So have your batch class call an apex web service that in turn calls your @future method.There is one trick here. To call your web service from the batch class, you need a session Id. Don't call Userinfo.getsessionid from a scheduled batch class. You won't get a result. Instead, call Userinfo.getsessionId from your schedulable class and pass the id into your batch class as a parameter. Now you have everything you need to call @Future from a batch. For more information please check with below links from the community.
- https://salesforce.stackexchange.com/questions/24843/calling-future-method-from-batch/24853
- https://developer.salesforce.com/forums/?id=906F0000000kK6VIAU
Hope this answers your question.
Please mark this post as solved if the information helps so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.Thanks,Nagendra