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
ramesh babu 114ramesh babu 114 

Can we call future method in batch class?

 Can we call future method in batch class?
Suraj TripathiSuraj Tripathi
Hi Ramesh,

Salesforce doesn't allow a future method to be called from another future method or a batch job. Before calling your future method, you should check if a future or batch job is already running. This would be a best practice for any code you ever write that calls a future method. Good news is that it's very easy. Example below: 

if(System.IsBatch() == false && System.isFuture() == false){ 
    // make your future call here 
}

Hope it Helps you. Mark this answer Solved if it resolves your query.

Regards ,
Suraj​

 
farukh sk hdfarukh sk hd
No,You Cannot call future method from batch class.

For more information on future method visit,

https://www.sfdc-lightning.com/2018/10/future-methods-in-salesforce.html