Queries:
When a delegation is given to a supervisor/ div head and the delegation start date is the same as the current date, the email is sent to the corresponding delegating person. Now we don’t consider the context. Since there is a possibility to change any field values in the delegation record like start date/ end date. So do we need to change the logic / does it work only in the create context?
Now one employee can create more than one delegation record. When more than one delegation records are created then the time approver field of subordinates is overwritten each time the script executes. Do we need to restrict it to a single record at a period? Does any other logic is to be applied to this scenario?
Initial Findings
We have to follow the following points in our new development
Currently a user event script is used to assign the responsibility to the corresponding supervisor or div head based on if they are on available or not. This will work at real time if the delegation start date is same as to the current date. So we have to update this script to assign the responsibility to an admin person during the creation. And set the time approver filed.
If the delegation start date is more than the current date with the help of a scheduled script we will send the email. Here also we use the same logic to send the email. Same logic has applied this script also.
When the supervisor or div head is on leave then we can add these employees to the cc email if we assign responsibility to the admin person.
Aslo now we have used a logic that if the supervisor is on leave ana he is currently a delegation person of his subordinate then we will send the email to the div head. So her we have to add another level of checking is the div head is also available. Then the div head is also on leave we have to we have to send email to the admin person.
The delegation end status setting have no changes.
When the employee delegation record is created with Inprogress status the delegated to person value is to be set to the field STAND IN APPROVER in the employee record and check the check box UNABLE TO APPROVE. Currently we have not considered the scenario in which removing the Stand in approver filed after the delegation expires.