Global Absence Entry Validation
The Global Absence Entry Validation fast formula can be used in cases where a custom data validation or business rule validation needs to be performed when an absence entry is being made.
An organization might have a rule that allows a worker to record an absence entry of type Maternity Leave – Unpaid, only in sequence with a regular Maternity Leave absence entry. In such a case, a validation formula can be composed which looks at the Workers absence history to identify if there is a Maternity Leave that is ending on the day just before the absence entry of Maternity Leave - Unpaid.
Configuration Point in HCM Cloud
If you have created this formula, you can attach this formula to the absence type definition.
Navigation
- In the Absence Administration work area, click Absence Types to open the Absence Types page.
- On the Search Results section toolbar, click Create to open the Create Absence Type dialog box.
- Click Continue.
- On the Create Absence Type page Type Attributes tab, General Attributes section, select the defined formula in the Validation Formula field.
Contexts
The following contexts are available in this formula type:
Context Name | Data Type |
---|---|
ABSENCE_AGREEMENT_ID | Number |
ABSENCE_CERTIFICATION_ID | Number |
ABSENCE_ENTRY_ID | Number |
ABSENCE_REASON_ID | Number |
ABSENCE_TYPE_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_AGREEMENT_ID | Number |
PERSON_ID | Number |
START_DATE | Date |
Input Values
Variable Name | Data Type | Description |
---|---|---|
IV_START_DATE | Date | Start date of absence entry |
IV_END_DATE | Date | End date of absence entry |
IV_TOTALDURATION | Number | Duration of absence entry |
IV_START_DURATION | Number | Start date duration of the absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule |
IV_END_DURATION | Number | End date duration of the absence entry. Applicable when absence entry is being recorded against an Elapsed based work schedule |
IV_START_TIME | Text | Start time on the start date of the absence entry. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 00:00. |
IV_END_TIME | Text | End time on the end date for the absence being entered. Applicable when absence entry is being recorded against a Time based work schedule. For elapsed work schedules it will be 23:59. |
IV_ACTUALCHILDBIRTHDATE | Date | Actual date of childbirth entered for the absence. Applicable for Childbirth/placement absence pattern |
IV_ACTUALSTARTDATE | Date | Actual start date of absence. Applicable for Childbirth/placement absence pattern |
IV_ACTUALENDDATE | Date | Actual end date of absence. Applicable for Childbirth/placement absence pattern |
IV_EXPECTEDCHILDBIRTHDATE | Date | Expected date of childbirth entered for the absence. Applicable for Childbirth/placement absence pattern |
IV_PLANNEDSTARTDATE | Date | Expected start date of absence. Applicable for Childbirth/placement absence pattern |
IV_PLANNEDENDDATE | Date | Expected end date of absence. Applicable for Childbirth/placement absence pattern |
IV_ABSENCE_REASON | Text | Absence reason in the language of the current session |
IV_ATTRIBUTE_CATEGORY | Text | Context of the DFF row for Absence Recordings DFF |
IV_ATTRIBUTE_1* | Text | First text segment of the Absence Recordings DFF |
IV_ATTRIBUTE_NUMBER1* | Number | First number segment of the Absence Recordings DFF |
IV_ATTRIBUTE_DATE1* | Date | First date segment of the Absence Recordings DFF |
IV_ATTRIBUTE_ARR | Text_Number | Array of text segments of the Absence Recordings DFF. The index indicates the segment number. Eg: IV_ATTRIBUTE_ARR[1] holds the value of segment ATTRIBUTE1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_ATTRIBUTE_ARR.exists(1)) |
IV_ATTRIBUTE_NUMBER_ARR | Number_Number | Array of number segments of the Absence Recordings DFF. The index indicates the segment number. Eg: IV_ATTRIBUTE_NUMBER_ARR[1] holds the value of segment ATTRIBUTE_NUMBER1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_ATTRIBUTE_NUMBER_ARR.exists(1)) |
IV_ATTRIBUTE_DATE_ARR | Date_Number | Array of date segments of the Absence Recordings DFF. The index indicates the segment number. Eg: IV_ATTRIBUTE_DATE_ARR[1] holds the value of segment ATTRIBUTE_DATE1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_ATTRIBUTE_DATE_ARR.exists(1)) |
IV_INFORMATION_CATEGORY | Text | Context of the DDF row for ANC_PER_ABS_ENTRIES DDF |
IV_INFORMATION_1* | Text | First text segment of the ANC_PER_ABS_ENTRIES DDF |
IV_INFORMATION_NUMBER1* | Number | First number segment of the ANC_PER_ABS_ENTRIES DDF |
IV_INFORMATION_DATE1* | Date | First date segment of the ANC_PER_ABS_ENTRIES DDF |
IV_INFORMATION_ARR | Text_Number | Array of text segments of the ANC_PER_ABS_ENTRIES DDF. The index indicates the segment number. Eg: IV_INFORMATION_ARR[1] holds the value of segment INFORMATION1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_INFORMATION_ARR.exists(1)) |
IV_INFORMATION_NUMBER_ARR | Number_Number | Array of number segments of the ANC_PER_ABS_ENTRIES DDF. The index indicates the segment number. Eg: IV_INFORMATION_NUMBER_ARR[1] holds the value of segment INFORMATION_NUMBER1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_INFORMATION_NUMBER_ARR.exists(1)) |
IV_INFORMATION_DATE_ARR | Date_Number | Array of date segments of the ANC_PER_ABS_ENTRIES DDF. The index indicates the segment number. Eg: IV_INFORMATION_DATE_ARR[1] holds the value of segment INFORMATION_DATE1 in ANC_PER_ABS_ENTRIES table. The index begins at 1 and ends at 30. If a particular index is used and data does not exist, the application would throw an error. Hence it is a good practice to first check if data exists before using the input value. This can be done using the “exists” command. Eg: if(IV_INFORMATION_DATE_ARR.exists(1)) |
IV_PAYMENT_DTL_BAND | Number | Identifier of the payment band chosen for the absence linked to an agreement |
IV_NOTIFICATION_DATE | Date | Date of Illness/Injury notification |
IV_MATCHING_DATE | Date | Date on which child is matched with the worker for adoption |
*The sequence for this input value can be extended up to 5
Return Variables
Variable Name | Data Type | Description |
---|---|---|
VALID | Text | Determines validity of absence entry. ‘N’ throws an error message and stops the transaction from being submitted |
ERROR_MESSAGE | Text | Custom error message for invalid absence entry. Error message can either be written into the formula or defined via Manage Messages and invoked here. |
ERROR_CODE | Text | Identifies if the message is Error or Warning.. Valid values are ‘E’ for Error and ‘W’ for Warning. |
TOKEN_NAME | Text_Number | Array of token names, if any, in the message configured via Manage Messages |
TOKEN_VALUE | Text_Number | Array of values passed to each token name in the message |
DEBUG_MESSAGE | Text | Text passed into this output variable would get logged if application logging is enabled. Useful for debugging. |
Sample Formula
Requirement: The organization has a Sickness absence entitlement policy according to which a worker can record a regular sickness absence entry only after the completion of 365 days from their last Unpaid Sickness entry.
Solution: A Global Absence Entry Validation formula such as the one below can be used.
FORMULA NAME: ANC_VALID
FORMULA TYPE: Global Absence Entry Validation
DESCRIPTION: This formula validates the Sickness absence entry
DEFAULT FOR IV_START_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT FOR IV_END_DATE IS '4712/12/31 00:00:00' (date)
DEFAULT_DATA_VALUE for ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_TYPE_ID is 0
DEFAULT FOR ANC_ABS_ENTRS_ABSENCE_STATUS_CD IS ' '
DEFAULT FOR ANC_ABS_TYP_NAME IS ' '
DEFAULT FOR ANC_ABS_ENTRS_END_DATE IS '4712/12/31 00:00:00' (date)
INPUTS ARE IV_END_DATE (date), IV_START_DATE (date)
lc_sickness_unpaid_name = 'Sickness - Unpaid'
ld_start_date = TO_DATE('1951-01-01','yyyy-MM-dd')
ld_sickness_end_date = TO_DATE('4712-12-31','yyyy-MM-dd')
i=1
CHANGE_CONTEXTS(START_DATE=ld_start_date, END_DATE=IV_END_DATE)
(
WHILE ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR.exists(i)
LOOP
(
CHANGE_CONTEXTS (ABSENCE_ENTRY_ID = ANC_PER_ABS_ENTRS_ABSENCE_ENTRY_ID_ARR[i])
(
CHANGE_CONTEXTS (ABSENCE_TYPE_ID = ANC_ABS_ENTRS_ABSENCE_TYPE_ID)
(
IF (lc_sickness_unpaid_name = ANC_ABS_TYP_NAME AND ANC_ABS_ENTRS_ABSENCE_STATUS_CD = 'SUBMITTED')
THEN
(
IF (365 > DAYS_BETWEEN(TRUNC(IV_START_DATE), ANC_ABS_ENTRS_END_DATE) + 1)
THEN
(
VALID = 'N'
ERROR_MESSAGE = 'ORA_CUSTOM_ERROR_MESSAGE'
RETURN VALID, ERROR_MESSAGE
)
)
)
)
i=i+1
)
)
VALID = 'Y'
RETURN VALID