Why do we need Global Absence Plan Enrollment Start fast formula?
In this article we will see how can you make use of fast formula Global Absence Plan Enrollment Start to enroll employees to an absence plan from some specific date. Before we proceed further it is important to understand the need of this formula and how useful it is when you are migrating data or setup from one instance to another. When we setup any absence plan from scratch the default accrual plan enrollment start date is As of event, which means employees will be enrolled to accrual plan on the day you run plan enrollment process (or the effective date you pass while running the process “Update Accrual Plan Enrollments”).
But what is the problem with this approach? Okay, lets assume there are 1000 employees in your organization with obviously different hire date. Now suppose you have completed your accrual configuration and employees are migrated. What you need to do now is enroll all these employees to an accrual plan by running the program “Update Accrual Plan Enrollments”, while running this program you will have to pass Effective Date as shown below and all employees will be enrolled to the plan from this date.
Suppose the date you passed is 1st Jan of this year, so what will happen to all those employees who were hired after 1st Jan? You must be thinking they will be enrolled from their respective hire date as they joined after 1st Jan, right? But unfortunately oracle cloud is still not that intelligent. This process will simply ignore all those employees and you will have hard time figuring this out. So, to overcome from this problem you will have to write a formula that will tell application to enroll all those employee from 1st Jan of this year who joined on or prior to 1st Jan and all remaining employees who joined after 1st Jan should get enrolled from their respective hire date.
How to write “Global Absence Plan Enrollment Start”
To write a formula navigate to task “Manage Fast Formula” and then click on create and then enter below information, once done click on continue
- Formula Name : AVI_ENRMNTSD_EXAMPLE
- Type : Global Absence Plan Enrollment Start
- Description : <Optional>
- Legislative Data Group : Either you can leave this blank so that the formula is available to all legislative data group or you can select one from the list.
- Effective Start Date : 1st Jan 1951
Now a new window will appear there on the formula text section, enter below code.
/****************************************************************************** FORMULA NAME: AVI_ENRMNTSD_EXAMPLE FORMULA TYPE: Global Absence Plan Enrollment Start DESCRIPTION: This formula will check the hire date of workers and if hired prior to 1st Jan 2019, will set 1st Jan 2019 as plan enrollment start date other wise the actual hire date : Name Date Version Comments ------------------------------------------------------------------------------- Avinash 06-May-2019 DRAFT 1A Initial Version ******************************************************************************/ DEFAULT for PER_PER_LATEST_REHIRE_DATE is '4712/12/31 00:00:00' (date) l_log = ESS_LOG_WRITE ('PER_PER_LATEST_REHIRE_DATE Date is : '||to_char(PER_PER_LATEST_REHIRE_DATE, 'DD/MM/YYYY')) IF ( PER_PER_LATEST_REHIRE_DATE >= '2019/1/1 00:00:00' (date)) THEN ( enrollmentStartDate = PER_PER_LATEST_REHIRE_DATE l_log = ESS_LOG_WRITE ('Employee Hire Date is : '||to_char(enrollmentStartDate, 'DD/MM/YYYY')) ) ELSE ( enrollmentStartDate = '2019/1/1 00:00:00' (date) l_log = ESS_LOG_WRITE ('enrollmentStartDate Date is : '||to_char(enrollmentStartDate, 'DD/MM/YYYY')) ) RETURN enrollmentStartDate
Note : In case of employee is rehired and you want plan to be active from his original hire date, you can replace “PER_PER_LATEST_REHIRE_DATE” with “PER_PERSON_ENTERPRISE_HIRE_DATE”
Once you have copied and pasted the code, click Save, Submit and Compile button. Wait for some time until formula is compiled filly and you see green check mark against compile status. Now you can safely close this window.
Attach the formula with accrual plan
Now the next step is to attach this formula with our accrual plan. For the same open your accrual plan by navigating to Home » My Client Group » Absence » Task Panel » Manage Absence Plan » Search for the plan » Click on the plan name » Click on the participation tab (second tab)
On this screen you will see Enrollment Rules section, change the Enrollment Start Rule to Formula and then select the formula “AVI_ENRMNTSD_EXAMPLE” we created earlier.
Now validate if formula is working as expected
To validate the formula we will take an employee who was rehired on 1st April 2019.
Now to enroll this worker (active assignment) navigate to Absence » Manage Absence Record » scroll below and you will see Plan Participation section.
Click on Enrollment and Adjustments button and then select Add Enrollment you will be asked to select plan name and an effective date. Here you can select any date but the employee will be enrolled from the hire date 1st April. If you select any other employee who joined the organization earlier than 1st Jan, he will be enrolled from 1st Jan only.
You can also validate this through program
For the same navigate to Home » My Client Group » Absence » Task Panel » Schedule and Monitor Absence Process » Run Update Accrual Plan Enrollments » in the Person filed select one person whom you want to test.
Where else we can use Global Absence Plan Enrollment Start
Please note this is also interesting to know that Global Absence Plan Enrollment Start is not just for the purpose described in this article. You can also use this formula to have different start date for different set of employees. Lets say every one in the organization should be enrolled to an accrual plan from their joining date but Secretaries (based on grade or job) should be enrolled only after completing three months in the organization. In such scenario you can make use of below code.
/****************************************************************************** FORMULA NAME: AVI_SECRETARY_ENRLMNT_SD FORMULA TYPE: This will return different enrollment start date for Secretary Name Date Version Comments ------------------------------------------------------------------------------- Avinash 06-May-2019 DRAFT 1A Initial Version ******************************************************************************/ DEFAULT for PER_PER_LATEST_REHIRE_DATE is '4712/12/31 00:00:00' (date) DEFAULT FOR PER_ASG_JOB_NAME IS ' ' enrollmentStartDate = PER_PER_LATEST_REHIRE_DATE IF (PER_ASG_JOB_NAME = 'Secretary') THEN (enrollmentStartDate = ADD_MONTHS(enrollmentStartDate, 3)) RETURN enrollmentStartDate
When we can’t use this formula
If an employee is already enrolled to a plan with some plan enrollment start date, even if you run the process “Update Accrual Plan Enrollments” with fast formula in place, it will not update the plan enrollment start date. So basically this formula is used only for the fresh enrollment. Alternative to this problem is you will have to delete the enrollment first and then re run the process “Update Accrual Plan Enrollments”.
Need more information about this fast formula
If you need more information about this fast formula type, you can see below return variables and context item this formula supports.
Return Variables
Variable Name | Data Type | Description |
enrollmentStartDate | Date | Start date of enrollment |
Contexts
The following contexts are available in this formula type:
Context Name | Data Type |
ABSENCE_ENTRY_ID | Number |
ABSENCE_TYPE_ID | Number |
ACCRUAL_PLAN_ID | Number |
DATE_EARNED | Date |
EFFECTIVE_DATE | Date |
END_DATE | Date |
ENTERPRISE_ID | Number |
HR_ASSIGNMENT_ID | Number |
HR_RELATIONSHIP_ID | Number |
HR_TERM_ID | Number |
JOB_ID | Number |
LEGAL_EMPLOYER_ID | Number |
LEGISLATIVE_DATA_GROUP_ID | Number |
ORGANIZATION_ID | Number |
PAYROLL_ASSIGNMENT_ID | Number |
PAYROLL_ID | Number |
PAYROLL_RELATIONSHIP_ID | Number |
PAYROLL_TERM_ID | Number |
PERSON_ID | Number |
START_DATE | Date |
If you ever want to know list of context supported by any fast formula you can go to this article Oracle Fusion (Cloud) Reusable SQL Queries and read section 3. Query to Get Context Supported by Any Fast Formula
How to debug Global Absence Plan Enrollment Start formula
You can read this article to understand how to debug this formula or any other absence fast formulas » How to Debug Oracle Absence Management Fast Formulas?
Have more question?
If you still have any question or doubt, please post them on our Oracle Fusion Forum.