Skip to main content
edited tags
Link
Adrian Larson
  • 151.3k
  • 38
  • 247
  • 431
added 33 characters in body
Source Link
Anurag
  • 2.2k
  • 7
  • 42
  • 68

I'm implementing an apex batch process.

public class BatchName implements Database.Batchable<XYZClass.wrapper>,Database.Stateful{

I have declared an integer variable as public and assigning value to it in execute method.

Public Integer Counter=0;

When I try to access it in finish method, I am getting null value.

While declaration, when i set it to zero, I'm getting zero. I'm unable to get the assigned integer value.

I'm using the database.stateful, as it allows you to maintain state.

Please help me. Am I overlooking anything here?

I'm implementing an apex batch process.

public class BatchName implements Database.Batchable<XYZClass.wrapper>,Database.Stateful{

I have declared an integer variable as public and assigning value to it in execute method.

When I try to access it in finish method, I am getting null value.

While declaration, when i set it to zero, I'm getting zero. I'm unable to get the assigned integer value.

I'm using the database.stateful, as it allows you to maintain state.

Please help me. Am I overlooking anything here?

I'm implementing an apex batch process.

public class BatchName implements Database.Batchable<XYZClass.wrapper>,Database.Stateful{

I have declared an integer variable as public and assigning value to it in execute method.

Public Integer Counter=0;

When I try to access it in finish method, I am getting null value.

While declaration, when i set it to zero, I'm getting zero. I'm unable to get the assigned integer value.

I'm using the database.stateful, as it allows you to maintain state.

Please help me. Am I overlooking anything here?

Source Link
Anurag
  • 2.2k
  • 7
  • 42
  • 68

Batch finish method getting null values

I'm implementing an apex batch process.

public class BatchName implements Database.Batchable<XYZClass.wrapper>,Database.Stateful{

I have declared an integer variable as public and assigning value to it in execute method.

When I try to access it in finish method, I am getting null value.

While declaration, when i set it to zero, I'm getting zero. I'm unable to get the assigned integer value.

I'm using the database.stateful, as it allows you to maintain state.

Please help me. Am I overlooking anything here?