Click HERE to see how Saviynt Intelligence is transforming the industry. |
08/02/2024 08:15 AM
In our application, we have a workflow where approval requests are sent to the manager and the manager’s delegate if one is set. Here’s the process:
First Level Approval:
Second Level Approval:
Issue: During the second level approval, if the manager’s manager’s delegate is set, the request is not being sent to the delegate.
Question: Why, during the second level approval, does the request not go to the manager's manager's delegate if one is set? Is there a way to use a custom query in a custom assignment block to fetch the manager's manager's delegate user key?
08/02/2024 09:34 AM
I found the solution. By using the query below in a Custom Assignment block of the workflow, the approval is directed to the delegate assigned to the manager's manager. We need to set the assigned delegate's name for the user on the "Do Not Disturb Delegate" at the user level.
SELECT userkey
FROM users
WHERE userkey = (SELECT u1.userkey
FROM users u
JOIN users m ON u.manager = m.userkey
JOIN users mm ON m.manager = mm.userkey
JOIN users u1 ON mm.donotdisturbdelegate = u1.username
WHERE u.userkey = ${user.id}
)
08/02/2024 12:31 PM
So is there is any need to use custom assignment block?
08/02/2024 04:38 PM
Its not mandatory to set users in donotdelegate
Use below query
select
delegatedUserManager.userkey
from delegates d,
USERS delegatedUser,
USERS delegatedUserManager
WHERE delegatedUser.USERKEY = D.DELEGATEUSERKEY
AND delegatedUser.STATUSKEY = 1 AND DATE(D.ENDDATE) >= DATE(NOW())
AND delegatedUserManager.userkey=delegatedUser.manager AND D.userkey = ${user.id}