• #66117
    Salesforce | Nikita Nikita #3
    Forcetalks

    Why Static variables loose their state in batch class during every execution in Salesforce?

    Why Static variables loose their state in batch class during every execution?

     

    #66158
    Salesforce | Deepak Deepak #4
    Forcetalks

    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

Viewing 2 posts - 1 through 2 (of 2 total)

Please to reply to this topic.

Popular Salesforce Blogs

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2020 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?