You need to sign in to do that
Don't have an account?

Batch class in Apex??
I have below questions w.r.t. batch class.
1- What is batch apex class?
2- what are all the methods defined in batch apex class?
3- what are the return types and syntaxes of all methods of batch apex class?
4- when we need to go for batch apex class?
It would be a great help if anyone can shar one's own experience for these questions rather than sharing link of documents.
Thanks!
1- What is batch apex class?
2- what are all the methods defined in batch apex class?
3- what are the return types and syntaxes of all methods of batch apex class?
4- when we need to go for batch apex class?
It would be a great help if anyone can shar one's own experience for these questions rather than sharing link of documents.
Thanks!
>> It allows you to define a job that can be divided into manageable chunks, where each chunk can be proceed separately.
2- what are all the methods defined in batch apex class?
>> To use Batch Apex, you must implement “Database.Batchable”. This interface has three methods. those are:
1. Start
2. execute
3. Finish
3- what are the return types and syntaxes of all methods of batch apex class?
Start: Execute:
Finish:
4- when we need to go for batch apex class?
>> when you want to do a bulk job.
To have higher governor limits.
We can schedule to run at different time.
Could you please brief me about return type of these methods,
Thanks!
Use the Database.QueryLocator object when you are using a simple query to generate the scope of objects used in the batch job. In this case, the SOQL data row limit will be bypassed.
Use iterable object when you have complex criteria to process the records. And, governor limit for the total number of records retrieved by SOQL queries is still enforced, if you use this.
Execute method gets called after the Start method and does all the processing required for Batch Job. list<P> parameter from given syntax is returned by the Database.QueryLocator method. Return type of this method is void.
Finish method executes after all batches are processed. You can use this method to send confirmation email notifications or execute post-processing operations. Return type of this method is void.