I've got code to create and submit for approval a custom object. I'm running into the DML statement limit.

As far as I can see each record I submit for approval takes up a DML statement, but there's no option to submit in bulk.......

Am I missing something?

1 Answer 1


You can submit multiple Records for approval, sample code below.

List<Approval.ProcessSubmitRequest> requests = new List<Approval.ProcessSubmitRequest> ();
     for (Id oppId: opportunities) {
                    Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();
                    req1.setComments('Submitting request for approval ');

      Approval.ProcessResult[] processResults = null;
                try {
                    processResults = Approval.process(requests, true)
    }catch (System.DmlException e) {
        System.debug('Exception Is ' + e.getMessage());
  • Thanks @techtrekker! Couldn't see this in the docs. Just a note that you need to create the variable requests, something like: list<Approval.ProcessSubmitRequest> requests = new list<Approval.ProcessSubmitRequest>();
    – ChrisN
    Commented Oct 12, 2012 at 10:48
  • Absolutely, missed writing the declaration. Commented Oct 12, 2012 at 11:01
  • perhaps you could update your answer ;) Commented Oct 12, 2012 at 11:07
  • My thoughts exactly.... done ! :) Commented Oct 12, 2012 at 11:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .