I have a somewhat complex approval process to implement. When a new Form is submitted I want it to go to the User's supervisor for approval, then to the User's Director for further approval. A Director may or may not be the User's Supervisor's supervisor. We have multiple Directors. Each user is subordinate to one Director. All Directors report to the CEO, who is at the top of the staff hierarchy.
How do I get the Director's name for a given user? Both the User and the Director will be in the same Dept. The number of intermediate steps between User and Director varies.
The process we want is... User --> Approver (Supervisor) --> Approver (Director)
In effect there is an unknown number of line managers. The user's reporting relationships might be any of the following, with the desired approvers shown in red...
User --> Line Manager X --> Director --> CEO
User --> Line Manager A --> Line Manager B --> Director --> CEO
User --> Line Manager G --> Line Manager H --> Line Manager J --> Director --> CEO
User --> Line Manager P --> Line Manager Q --> Line Manager R --> Line Manager n --> Director --> CEO
We also have the special case where the User is the Line Manager immediately subordinate to a Director i.e.
Line Manager W --> Director
Except for the special case we need 2 approvals...
- Approver 1 - The user's immediate line manager - GetManager (V2) does this nicely
- Approver 2 - The relevant Director
How do I find the relevant Director in every case?