How to automatically apply employee time/Absences for Birthdays/Marriage Anniversaries.
As all of us know, most of the companies are offering leaves to their employees on their birthdays (or) marriage anniversaries to encourage their employee to spend the time on special days with family (or) friends.
In same context from multiple customers there is requirement to apply this kind of leave automatically before certain number of days and now lets take a look how do we achieve this.
- MDF object
- One Save Rule to create current year marriage anniversary date based on Marriage anniversary date. For Example :- if employee birthday is on 17/July/1987, then this rule will create the current year marriage anniversary date as 17/July/2021.
- Two Integration Center Jobs
- Integration center Job to get the information from Personal Info to MDF object.
- Another Integration center job to create the absence/employee time based on MDF data.
Now lets check the configurations: –
Create MDF with below fields.
- External code :- Configure it as User filed (Add name of you choice, I am using it as dummy field 😊)
- Marriage anniversary Date : – This date will flow from personal information and update here on daily basis.
- Current Year Marriage Date : – This fields will be updated automatically as per current year based on business rule assigned in “Save rules” section of MDF Object.
4. Trigger Date:- This filed also will be updated automatically based on client requirement by another save rule (you can use the same rule which is written for above field also but different set conditions).
5. (ET EC) Another String Field for store employee time external code :- In this field I will generate employee time external code and will use while creating the absence automatically (you can use the same rule which is written for above field also but different set conditions).
FYI – Here is my rule with all of 3 set conditions in single rule.
Step 3: –
Now we need to take 2 eggs, 1 medium size onion, 3 green chilis, salt, pepper and 1 table spoon of oil to make an omelet (you can customize as per your needs) to refresh ourselves and take breath 😊.
Integration Job 1:-
This job will get all employee marriage anniversaries form personal information to MDF and only 3 fields we need to map.
- User Id from Employment details > External code in MDF.
2. Effective Start Date > Make it default as current date always (this can be your choice)
3. Marital Status Since > Marriage Date
4. Use the below filters in integration job to avoid inactive employees who are not married.
Below is the big picture of integration mapping (You can check this in Review & Run Section)
Note: – When this integration jobs runs and MDF is created, business rule what have written in Step 2 will automatically populates below information.
- Current Year Marriage date
- Trigger Date
- ET EC fields
This job will create employee time automatically by checking Trigger Date.
Below is the field mapping to create employee time.
- External code > ET EC ( we have created a filed in MDF and external code is already generated through business rule in Step no 2).
2. Approval Status > should be default value as “APPROVED”
3. Start Date > Current Year Marriage Date.
4. End Date > Current Year Marriage Date (Both start and end date will be same as the leave is applied for single day).
5. Time Type > Hard code/default the time type code here.
6. userId > external code of MDF object
7. Use below filters to trigger the job when the “Trigger Date” is equal to today & employee is not inactive.
Schedule both the jobs one after another on daily basis.
When you run the job leave will be automatically applied for employee on current year marriage anniversary.
You can use the same solution for applying leave on employee birthdays also 😊.