Restrict Approval of Case Once Closed
The issue is that even after I close a case using the Workflow, a Manager is able to go back in via the Approval History (or their Home Page) and click the Approve/Reject button and Approve the case. I have tried writing a Validation Rule that will restrict editing the Case once closed ... but this rule doesn't seem to fire if the Approval Process edits the case.
Is there anything that I can do, to ensure that once a case is closed, a Manager can NOT go in and approve (or reject) the case, thus "reopening" it?
I dont think there is anything you can do to prevent this scenario to happen - as the approval process is kind of agnostic of the current state of the record - it only cares on the state of the record once is triggered to see the criteria is met.
I would suggest you to use the standard report so you can see which approval processes are outstanding and then manually close them.
Go to the Reports Tab > Click on the Administrative Reports Folder > All Pending Approval Requests report.
There is no ID available for the approval record so I dont think you can mass update them via data loader.
If there are a lot of records to update and this becomes in a time consuming task - you could set a filed update to re-activate the case once is approved.
You can vote for the idea though
You could leverage record types, add a second record type for a closed case that has it's own Page Layout. In the Closed Case Layout, removed the approval history related list, which would prevent the manager from approving.
If you find this response helpful, let the community know by marking the answer as "Best Answer" right under the comment.This will help the rest of the community should they have a similar issue in the future. Thank you!
Any other ideas?
If you want to go @Jim's route you could create a trigger that fires after update and get this trigger to query the approval process associated to the record and reject it. I know you can submit for approval using a trigger but I am not sure if you can query a pending approval process associated to a record and then manipulate it (acepting it or closing it).
Here are some links that may help you:
Triggers and order of execution > http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_triggers_order_of_execution.htm
Apex approval process > http://forums.sforce.com/t5/forums/forumtopicprintpage/board-id/apex/message-id/127463/print-single-message/false/page/1
Another avenue to review is to see if you can get access to the approvalobject via data loader and perform mass updates via that way -- The report in salesforce that shows you the pending approval processes does not expose an Id so it seems like not.
So overall you you can flip the RT via a time based WFR, in the layout of the new RT remove the approval history section and then make the WFR fire a trigger (if possible) that queries the approval proccess associated to the record and then rejects it - so the approval is removed from the home page layout of the approvers.
That way, we won't need to flip the RT or create new WFR ... just a single trigger should do the trick. When it's built, I will post the code in case anyone else has issues.