As per the meeting, we have added the following points regarding the suggestion made by the RAF team.
Adding validation when the delegation record has no email for either supervisor/ div head
Giving the delegation to the div head if the supervisor is already available.(but has a delegation record that will active very next day)
Updates to the delegation expiring scripts check that his subordinates has any delegation record.
When employees create a delegation record for future, there can be a possibility of the delegation person is available or not.
ould you please update the due date and estimate of the task to complete the development as per the suggestion from the RAF team.
New suggestion added are,
Set the value to the delegation field only when saving the record.
Enable the employee selection field only in the create context
Enable the delegate To person for the role admin.
During the creation context and edit context seperatively for assigning the delegation.
During the creation context of a delegation record, if the delegation start date is current date/ less than the current date, then the delegations status is set as In progress, we have to send delegation mail, we have to set the time approver field of subordinates with the delegate person value. Set the STAND IN APPROVER in the employee record and check the check box UNABLE TO APPROVE.
Then we have to check that the current employee has any other delegation responsibility of his subordinates when the delegation is active on the current date. Then get the delegation records and check that he is the supervisor/ or div head. Then check if the corresponding supervisor is available. If he is not available then, check div head is available, if the div head is also not available then assign the responsibility to the admin person. Change all the subordinates time approver value. Then change the STAND IN APPROVER Value. And send an email to the new delegate person value. Also, the delegate person value is updated in the custom record also.
If the delegation start date is other than a day then set the delegation status as Planned. Delegate To is not to be considered. Only during the activate time it is to be considered.
During the Edit Context
During the edit context send the email only if the delegation start date, end date, and delegate person are changed in the edit context with In progress status. All the above points are considered.
Also once the status is changed from In progress to Planned, then empty the time approver field of subordinates.
Map Reduce
We will set the delegated person at the start day of employee delegation activation. All other points are the same as the user event script
Delegation Expiration checking Map Reduce Script
Get all the subordinates of the employee. Check that the employee has a delegation record. Then check that the delegate To is not the supervisor, then update the value. Change all the subordinate’s time approver values
Either we can notify the old delegate to a person with an email.
Additional Validation and points
If the email is empty then, have to add a validation like the email is not available.
All the country has the same time zone so we can schedule the scripts with no other issues.
Add additional validation in which when a delegation start date is coming in the range of other planned or in progress delegation records of the same employee then we will add an alert to create a new delegation record.