Approvers are deleted automatically by system itself
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2017 06:21 AM
As per our business requirement , when a request is raised for application/applications access, it goes for first level approval to caller's manager. When the first level approval is done, it goes to the second level approval to the respective application's owner.
Now there are approval groups formed for each application and there are members in each approval group. The issue is that when the first level approval is done by manager, the approvers get deleted for few applications by system itself. Kindly note the whole approver group gets deleted.
Can anyone help why the system is deleting approval group(approvers) automatically by itself??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2024 04:10 PM
Hi Kavita. Our solutions are almost identical. The one I've used is designed for re-use as our approvals are often sub workflows that we drop into our workflows for simpler/consistent development.
// Make sure wf_activity of the last approval is removed
// to avoid the deletion of the record
var sysid_current = current.sys_id.toString();
var grApproval = new GlideRecord('sysapproval_approver');
grApproval.addEncodedQuery('state=approved^wf_activity!=NULL^sysapproval=' + sysid_current);
grApproval.query();
while (grApproval.next()) {
grApproval.setValue('wf_activity', '');
grApproval.setWorkflow(false);
grApproval.update();
}
var grGroupApproval = new GlideRecord('sysapproval_group');
grGroupApproval.addEncodedQuery('approval=approved^wf_activity!=NULL^parent=' + sysid_current);
grGroupApproval.query();
while (grGroupApproval.next()) {
grGroupApproval.setValue('wf_activity', '');
grGroupApproval.setWorkflow(false);
grGroupApproval.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2024 05:03 PM
Yeah that's useful. Thanks for sharing.
We use flows for most processes. Flows don't automatically delete the approvals.
This scenario is an exception. Here we needed to create parallel approvals alongwith task creation option for the approver on the fly and wait for the task to be closed before they can approve/reject the approval request. (a bit complex to explain here :D)
So we are using Approval coordinator from workflow & calling that workflow from the main flow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2020 07:45 AM
Hi ,
I know that this is old post but if anyone looking for solution to this. Create business rule on sysapproval_approver table onbefore - Delete and then set the current.setAbortAction(true).
if there is specific workflow OR workflow context on which approvals were deleted then , have a GlideRecord query to wf_context table and then set the current.setAbortAction(true).
Thanks,
Nitin