Custom Query Callback for Reassigning and Adding Approver
Approvals admins can determine predefined subset of users, groups, queues or roles to be added as ad hoc or additional users to the list of approvals for in-flight approval requests. Approvals also supports a custom callback code to filter query users, roles and queues for reassigning and adding an approver on the My Approvals page.
- Reassigning Approver: Selects all users, queues, or roles
- Add Approver: Selects all users, queues, or roles
To override the default behavior
From the Approval System Properties in the Reassign Filter Page custom setting, name a Visualforce page that lets users select from a filtered list of users, queues, and roles.
To specify the custom reassign user search
- Go to Manage for Approval System Properties. and click
- In the Reassign Filter page, specify the name of the Visualforce page.
- Click Save.
To override the Default Query Callback class
Use Case
A sample implementation of a custom callback with custom filters to reassign and add approver users and to add approver users, queues, and roles is presented here. Your custom class can be simpler or more complex. Each method takes two parameters: the approval request context object the user has selected to reassign or add approvers to, and the search text entered in the search box for additional record filtering. Each method in your callback class must return a list of User, QueueSObject, or UserRole objects in each of the three methods.
You must define your class as global for the callback mechanism to work.