Mass Approval | Approve/Reject Multiple Records at once

Approving multiple record one by one is a painful activity. You have to open each record, click Approve & then give comment. Mass Approval lightning component will provide you a greater efficiency for this.

With this component you can see all Approval requests pending on the login User. And you can multi select and approve them on a single button click.

Component Features:
  • Approvals of upto 25 objects can be seen. (Configurable)
  • Multi select records and approve/reject at once.
  • Ability to add comments before approving or rejecting.
  • Auto query Name field to have better understanding of pending records

One important thing to notice here is that to query multiple records, query is done in FOR LOOP. But that’s not a point of worry as you can hit 100 SOQL in single transaction and it’s just 25.

Component Preview:

Mass Approval of Approval Requests

 

Step-1: Create an Apex controller and Exception Class

We need to create an Exception class first to throw the custom exception and Apex controller which will fetch all pending Approval requests of the current Login User.

Create MyException.cls Apex class.

Now create MassApprovalController.cls Apex class.