Activity Forums Salesforce® Discussions What is the use of Database.Stateful in batch Apex in Salesforce?

  • Laveena

    Member
    September 26, 2019 at 7:20 am

    Hi Hariom,

    If you specify Database.Stateful in the class definition, you can maintain state across these transactions. When using Database.Stateful, only instance member variables retain their values between transactions. Static member variables don't retain their values and are reset between transactions.

    Thanks

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos