1

I have looked through several blogs and couldn't find a detailed document that includes all methods of Database class. I could only get detail of start, execute and finish. I am interested in details about Database.BatchableContext, Database, Database.Batchable, update and every other that exists for that class.

3

Don't go to blogs for this kind of thing, go straight to the source: documentation! Batch apex is well documented. Start with the linked references in the Apex Developer Guide and work through the relevant Trailhead modules. Here are some references you should examine:

  • Database Class

    • executeBatch(batchClassObject)
      Submits a batch Apex job for execution corresponding to the specified class.

    • executeBatch(batchClassObject, scope)
      Submits a batch Apex job for execution using the specified class and scope.

  • Batchable Interface

    • execute(jobId, recordList)
      Gets invoked when the batch job executes and operates on one batch of records. Contains or calls the main execution logic for the batch job.

    • finish(jobId)
      Gets invoked when the batch job finishes. Place any clean up code in this method.

    • start(jobId)
      Gets invoked when the batch job starts. Returns the record set as an iterable that will be batched for execution.

    • start(jobId)
      Gets invoked when the batch job starts. Returns the record set as a QueryLocator object that will be batched for execution.

  • BatchableContext Interface

    You'll likely never need to call the methods on this parameter, but it has two:

    • getChildJobId()
      Returns the ID of the current batch job chunk that is being processed.
    • getJobId()
      Returns the batch job ID.
  • Using Batch Apex Unit

3
  • I am getting this error. "Sorry, the document you are looking for doesn't exist or could not be retrieved." while opening Developer guide that you suggested. However I didn't think about trail head, looks like good information there. Thanks I will start with trailhead. Are yo facing the same error while opening developer guide too?
    – Ricky
    Feb 2 '17 at 15:41
  • Trailhead is always a good place to start. I am not getting that error, but try googling it yourself. Either just search Database methods apex or even just Apex Developer Guide, and then use the search functionality within the developer guide.
    – Adrian Larson
    Feb 2 '17 at 15:43
  • 1
    Yup, I could download the PDF and can refer to that now, Excellent source of information there. Thank You.
    – Ricky
    Feb 2 '17 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.