Execute Batch Apex from lightning component with progress bar to show batch job status

4:18 PM


In this post we will see how to execute a batch apex class and add a lightning component to display the progress of the batch job.

The batch job progress status is retrieved from the object AsyncApexJob.

Let's first create a batch job.

Create an apex controller for the lightning component

Create a lightning component for the progress indicator.


4 comments

  1. This is perfect. I was struggling to find a user-friendly way to execute a batch process. I LOVE the progress indicator. Thanks for such a useful blog post!

    ReplyDelete
  2. How can we get response once the job is completed. I am updating a CSV file and would need to show status of each row back once job is completed.

    ReplyDelete
  3. HOw can I get a response (some custom inner class type) after I have the job completed. I am not storing the data in the database.

    ReplyDelete
  4. Could you please advise..how this can be done on LWC

    ReplyDelete