Activity Forums Salesforce® Discussions What is difference between stateful and stateless in batch class in Salesforce?

  • What is difference between stateful and stateless in batch class in Salesforce?

    Posted by Pooja on March 12, 2020 at 1:48 pm

    What is the difference between stateful and stateless in batch class in Salesforce?

    Anjali replied 4 years, 8 months ago 2 Members · 1 Reply
  • 1 Reply
  • Anjali

    Member
    March 12, 2020 at 2:31 pm

    Batch Apex is stateless by default. That means for each execution of your execute method, you receive a fresh copy of your object. If your batch process needs information that is shared across transactions, one approach is to make the Batch Apex class itself stateful by implementing the Stateful interface.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos