One of the most awaited solutions is here....Enjoy
Often in middle east countries, we come across a requirement for sick leave where the validity is not something which is fixed i.e based on hire anniversary or Jan- Dec etc. The validity varies based on some conditions. Below is a sample requirement which we see typically in these countries.
Note: This is also part of the best practice solution via upgrade center. Then you would pretty much get this config automated and deployed in your system in a matter of minutes.
Disclaimer: This is one of the custom workaround solutions that I have built. You may have to adapt or extend this further based on your client’s requirements.
External Code: User
Cust_SickLeaveStartYear : Sick leave Quota Start Date of a new sickness year
Cust_SickleaveEndYear: Sick leave Quota End Date of a new sickness year
Each time an employee needs to create a first sick leave which does not belong to previous period OR if this is the first sick leave in the system for an employee, the employee requests a new window period through this tracker object. The employee just keys in the effective start date (basically the start date of the first sick leave). The Sick Leave Quota Start Date and End date are filled by business rules
Here are the on Save rules attached to the MDF object
The above rule checks two conditions
The above rule flashes a message to employee that the tracker request is successful and he/she needs to wait for 5 mins for the time account to get created post which they can start requesting the sickness leave for that sickness year. The idea is to schedule IC every 5 mins so that it picks the latest tracker records.
Imp Note: The above is a sample message indicating that it may take up to 5 mins for IC to create records. In reality, this can also take longer and depends on IC Scheduling. Hence my advice would be to take a higher time frame like an hour or so so that the jobs can run efficiently and also modify the above message according to your frequency. For more details on scheduling refer to IC implementation guide which gives you more clarity on how to schedule these with the best frequencies
An Adhoc time account needs to be created with below settings
If the balance gets lapsed after every sickness year or bookable end date, attach a standard PEP rule which closes this account.
Also, to ensure, the employee does not overuse the accounts, you can maintain the “balance cannot fall below” field as 0
Create the below time type along with a take rule as shown below. Link the Time type to Adhoc Time account type created above
The take rule is to handle cases , when an employee tries to request a leave outside the current window period of a sickness year.
There is another take rule where we need to check that the first sickness leave should always start from the sick leave tracker date. This can be validated using below rule
Add these take rules in the same order to the corresponding time type.
Finally link this time type to a corresponding Time profile
The integration centre is the heart of this solution. Once the tracker is requested by the employee, we need to create a new adhoc account with specific dates and amount (120 days)
You would need to create a SF to SF OData Integration with Starting entity as “Sick Leave Tracker” and target as “Time Account”
1) External Code of Time account is a calculated field which concatenates the user ID with effective start date of tracker
2) Time Account Type can be hard coded with TAT you use. For example:
3) Booking Possible Until is mapped to Sick Leave End Date (Quota End Date) field of custom MDF
4) Booking possible from, account valid from and account valid to are all mapped to Sick Leave Start Date (Quota Start Date) field of custom MDF
5) User ID is mapped to external code of custom MDF
6) Time account Details (Child of Time account)
The payload should like below
{ "externalCode": "1060382021-11-22", "accountType": "SICK_LEAVE_NK_DEMO", "bookingEndDate": "/Date(1668988800000)/", "bookingStartDate": "/Date(1637539200000)/", "endDate": "/Date(1637539200000)/", "startDate": "/Date(1637539200000)/", "userId": "106038", "timeAccountDetails": [ { "TimeAccount_externalCode": "1060382021-11-22", "externalCode": "1060382021-11-22", "bookingAmount": 120, "bookingDate": "/Date(1637539200000)/", "bookingType": "INTERIM_UPDATE", "bookingUnit": "DAYS", "__metadata": { "type": "SFOData.TimeAccountDetail", "uri": "TimeAccountDetail(TimeAccount_externalCode='1060382021-11-22',externalCode='1060382021-11-22')" } } ], "__metadata": { "type": "SFOData.TimeAccount", "uri": "TimeAccount(externalCode='1060382021-11-22')" }
Last step is to add a filter. You can go with a combination of last modified date and effective date range so that only few records as of today, past year and future year at max are considered for creation, updates
With this we are done with setup. Now time for some testing
Hire an employee with a time profile that contains above time type
If the employee tries to request a sick leave, an error is raised which directs an employee to request a tracker first
Now employee goes to sick leave tracker and requests a tracker for Say Oct 8th 2020
Imp Note: The above is a sample message indicating that it may take up to 5 mins for IC to create records. In reality, this can also take longer and depends on IC Scheduling. Hence my advice would be to take a higher time frame like an hour or so so that the jobs can run efficiently. For more details on scheduling refer to IC implementation guide which gives you more clarity on how to schedule these with the best frequencies
After IC is run, check the time account for employee. It will be created with one year horizon from Oct 8th 2020 to Oct 7th 2021
If the employee tries to change now the dates , Say he/she changes the date from Oct 8th to say oct 6th an error is thrown
Any changes to the tracker post the account creation has to be dealt with by the admin. The admin can adjust the time account dates from manage data or import/export (if it is mass change) and then adapt the tracker.
Now say , the employee falls sick on Nov 20th 2021. This is outside the current window and he/she needs to request again a tracker with date as Nov 20th 2021.
This should now create a new Adhoc Account from Nov 20, 2021 to Nov 19 2022. As you can see that now there is a gap between previous sickness year and the new year which starts from Nov 20, 2021
Another account is created now with below timelines
This is a custom solution that can be used to tackle the typical sick leave scenarios of Saudi Arabia.
The advantage of using an Adhoc time account is that each account keeps track of all leaves including balances for a sickness year. Reporting and Using APIs to get the corresponding leaves, balance, or time account details for payroll should be possible as well. There also would be no issues encountered during cancellation or editing of existing leaves as each dedicated account and time off framework would take care of the same.
Hope this helps your implementation. We also plan to automate this and release this as a best practice solution
Stay Safe
Best Regards
Neelesh
Senior Product Specialist
Best Practices for Successfactors HXM
SF Product Management
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
28 | |
7 | |
3 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 |