Activity Forums Salesforce® Discussions When do we prefer future class rather than batch class in salesforce?

  • Saddam

    Member
    September 19, 2019 at 6:50 am

    Hi,

    Future Annotation:  Future Annotation is used to separate methods that are to be executed asynchronously.
    If Future Annotation is not used in a web service callout, the thread will wait until the response comes and other processes will not be executed.

    Batch Apex: Batch Apex is used to separate tasks that are going to handle more records(complex long running jobs) in background process. Batch Apex also runs asynchronously.
    If Batch Apex is not used for handling bulk records, we will hit governor limits set by Salesforce.com.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos