+ Start a Discussion
Becky Miller 15Becky Miller 15 

Approval Process - Recall already Approved records?

I am trying to be a Recall Button on the Quote Page:  I am receiving the error: A problem with the OnClick JavaScript for this button or link was encountered:  Unexpected Identifier.

Apex Class:
global class approvalRecall
    webservice static void recallApproval(Id recId)    
        List<ProcessInstanceWorkitem> piwi = [SELECT Id, ProcessInstanceId, ProcessInstance.TargetObjectId FROM ProcessInstanceWorkitem WHERE ProcessInstance.TargetObjectId =: recId];
        Approval.ProcessWorkitemRequest req = new Approval.ProcessWorkitemRequest();


var r = confirm("Are you sure want to recall the approval process?"); 
if(r == true) 

alert("Approval has been recalled"); 


alert("Recall Cancelled"); 
Swaraj Behera 7Swaraj Behera 7
Hi Becky,
Can you use id lower case instead capital letter.
Let us know if it works.

Becky Miller 15Becky Miller 15
That did not solve anything.  Nice idea though.
Anil MalneniAnil Malneni
can you replace ID to recId....


let me know if this works..

Thank you,