0

I have a batch apex class, and this class makes a SELECT with a limit of 1000.

after that, this class creates one campaign using insert, and processes others things, whatever.

the question is when I execute my class, it creates five campaigns in the same hour... how is this possible?

my class creates only one campaign.

the batch apex is executed multiple times at once when the volumetry of data is big?

1 Answer 1

3

By default, Batchable Apex processes the results from the start method in batches of 200. Presuming you're saying that you create one campaign in the execute method, then you would indeed have five campaigns. If you are using Database.executeBatch, you can provide an optional second parameter to specify a larger processing size, up to 2000.

Database.executeBatch(new MyBatchClass(), 2000);

In this case, with a limit of 1000 records queried, you would end up with just one execute call instead of 5.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .