Batch Apex

-Best Tool for working on millions of records it divides record into chunks or batches.

You Can use Batch Apex to Build Complex, Long-running processes that run on Thousands of records on the lightening platform.

–Operate over small batches/ Chunks of records.

–Can be Scheduled

–Implement Database.Batchable interface.

Batch Apex Contains Three Methods:

1.Start   : Executes Only Once

              Return batch scope or records

            Can Return upto 50 million records

2.Execute : Executes for Each batch/ chunks of records

              Must have void return type

              Each Execution will get new set of governor limits.

3.Finish  : Executes Only Once

              Called after all batches are processed

              Can be Used for post processiong

Scroll to Top