Activity Forums Salesforce® Discussions Why do will need Database.Stateful in a batch class?

  • Ratnesh

    Member
    July 27, 2020 at 6:06 am

    The only time you need Database. Stateful is when the execute method modifies a class variable in a way meant to be used across multiple execute methods or in the finish method. The majority of batches you will ever write will not need Database.

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos