You need to sign in to do that
Don't have an account?
Building dynamic approval flows in Apex
Hi,
I would like to know if anyone has any experience in building an approval process where the approvers are picked by the user before submitting the record for approval?
Basically, our use-case is as follows:
- We want to have a reference to multiple User objects (e.g. multi-select, multiple lookups - just assume this has been handled)
- Before submitting a record, the user picks one or several users as approvers
- When submitting the record, an approval process should be initiated
- Whenever an approver approves a record, it should go on to the next approver selected in the user list in step 1
I'm not sure if we can use the native approval process at all or if we are forced to basically code the whole flow ourselves?
Is it even possible to create approval processes in Apex? Can one intercept approval processes build by the native functionality and basically override who the next approver should be based on a set of criteria in the code?
I've found, and read, some topics on the boards but none of them seem to cover what we would like to achieve. Basically, we're looking for an extremely flexible solution where the submitter of the record decides the list of approvers.
I'm looking forward to some great input you guys.
Kind regards,
Søren Nødskov Hansen
You could create 10 or so user lookup field where you populate, behind the scenes, the approvers that the users picks.
Then set up the approval process to reference these fields.
Does that make sense?