I have a approval process set up already. when an agent submits records for approval, their status will be "Approval pending" and waits for Manager" i m trying to update their status as "approved" from list view. Accounts--> accounts listview-->select records-->click on 'approve records'--> shoud be approved.

the error. - Error:Cannot submit object already in process. How to avoid this?

I the controller i'm invoking Approval Process as below.

if(recs!=null && recs.size()>0){
    for(Lead ld : records){
        Approval.ProcessSubmitRequest AP1 = new Approval.ProcessSubmitRequest();
        Approval.ProcessResult result = Approval.process(AP1);
update recs;
  • I'm not sure you can do this - once a record goes into an approval process, it becomes locked. It can't go back into the same approval process until after it comes out via final approval/final rejection. Approval process field updates are used to update the 'status' as the record moves through the approval steps. These field updates can cause triggers to execute for additional processing
    – cropredy
    Commented Nov 4, 2014 at 22:42

1 Answer 1


I was able to figure this out. From the code i posted, i was resubmitting the record. Approval.ProcessSubmitRequest AP1 = new Approval.ProcessSubmitRequest();

By adding the line as below, i was able to get the workitem that i needed, refer the document for more information. (https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_ProcessWorkitemRequest.htm).

Approval.ProcessWorkitemRequest req2 = new Approval.ProcessWorkitemRequest();

  • Please mark this as the answer so it does not keep getting bumped by the automated processes..
    – Eric
    Commented Nov 11, 2014 at 5:03

You must log in to answer this question.

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