Activity Forums Salesforce® Discussions Why Static variables loose their state in batch class during every execution in Salesforce?

  • Deepak

    Member
    December 6, 2019 at 12:28 pm

    By default salesforce excuete the batch class like this from my understanding because  it it will not initialise to null there is chance to exist previous data  then the batch class will fail.
    if you will not initialise to null
    Let us assume you have excueted the batch with 200 records by five batches after excuetion of one batch list having 200 records again if we excuete the batch next two hunderd records will add to batch then list will be having 400records then the batch class can not excuete four hundered records at the the same then batch will fail like that there is a chance to happen like that

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos