- December 6, 2019 at 8:40 am #66117Nikita #3
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?December 6, 2019 at 12:28 pm #66158Deepak #4
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
Please Register to reply to this topic. /