Introduction
An element input validation formula is used to validate one or more element entry values. This type of Fast Formula is used to provide a default value for an element entry value, or to calculate entry values based on the user's entries in other entry values.
Some of the details like the page section , attribute field , usage as well as execution time associated with this type of fast formula is mentioned in below table:
Page Section |
Attribute / Field |
Usage / Purpose |
Execution Time |
||
Element Details or Element Eligibility |
Validation Formula |
To validate one or more entry values for the element based on entries in other entry values. |
On Saving Element Entry |
||
Element Details or Element Eligibility |
Calculation Formula |
To provide values for one or more entry values using a calculation that takes input from these or other entry values. |
On Saving Element Entry |
||
Element Details or Element Eligibility |
Defaulting Formula |
To provide default values for one or more entry values. |
On Element Entry Creation |
||
Input Value |
Validation Formula |
|
On Entering Element Entry Input Value |
Fast Formula Association Element Eligibility Section
*Note: In all cases, a formula at the element eligibility level overrides an equivalent formula at the element level
Contexts Associated with this Fast Formula
The following contexts are available to all formulas of this type:
-
LEGISLATIVE_DATA_GROUP_ID
-
DATE_EARNED
-
EFFECTIVE_DATE
The following contexts are available to formulas at element or element eligibility level only, not to validation formulas at the input value level:
-
PERSON_ID
-
PAYROLL_RELATIONSHIP_ID
-
PAYROLL_TERM_ID
-
PAYROLL_ASSIGNMENT_ID
-
HR_RELATIONSHIP_ID
-
HR_TERM_ID
-
HR_ASSIGNMENT_ID
Input Variables
The following input variables are available to formulas of this type.
Formula Usage |
Input Variables |
Comments |
Validation formula at input value level |
entry_value |
Passes the value to be validated. You must declare the input variable as the appropriate type for the element input value. |
Validation formula at element or element eligibility level |
Any element input value name that corresponds to an entry value. |
Replace spaces in the input value name with underscores in the input variable name. It doesn't matter whether you use uppercase or lowercase for the name. |
Defaulting formula |
None |
Use database items or other logic instead. |
Calculation formula |
Any element input value name of an entry value. |
Replace spaces with underscores. You don't need to provide all of the available entry values |
Return Values
The following return values are available to formulas of this type
Formula Usage |
Return Values |
Comments |
Validation formula at input value level |
formula_status |
Must be either 'S' (success) or 'E' (error). Required. |
Validation formula at element or element eligibility level |
formula_message |
Text of message passed to user if the validation fails. Optional. |
Defaulting formula |
Any element input value name of an entry value. |
A return value overrides any default value provided on the input value in the element or element eligibility record. |
Calculation formula |
Any element input value name of an entry value. |
You don't need to return all of the available entry values. You can return the entry values that were passed in as input variables, or other entry values. |
Sample Formula
A sample Fast Formula Code snippet of the various categories for ready reference follows:
-
Validation Formula At Input Value Level:
Formula Text |
inputs are entry_value(date) if(entry_value = '01-APR-2008' (date)) then ( formula_message = 'Valid date' formula_status = 'S' ) else ( formula_message = 'Invalid date' formula_status = 'E' ) return formula_message, formula_status |
-
Validation Formula at Element or Eligibility Level:
Formula Text |
inputs are hours_worked, rate, earning_date(date), comment(text) if(hours_worked > 80) then ( formula_message = 'You are within the working limit.' formula_status = 'S' ) else ( formula_message = 'You have worked too many hours.' formula_status = 'E' ) return formula_message, formula_status |
-
Calculation Formula at Element or Eligibility Level:
Formula Text |
inputs are hours_worked, rate, comment(text) if(hours_worked > 80) then ( rate = rate * 1.2 comment = 'Your rate has been increased' ) return rate, comment |
-
Defaulting Formula at Element or Eligibility Level:
Formula Text |
if(CATEGORY = 'S') then ( rate = 20 ) else ( rate = 30 ) rate_code = 'B' return rate, rate_code |
Seeded Fast Formula: Severance Payments Years of Service Input Value Validation
Till now we have tried to understand what an Element Input Value fast Formula is and the various places the same can be used along with an insight into the contexts , input variable and return values of the same.However, the delivered Application has few Element Input Value Validation fast formula pre-built already. One such formula is Severance Payments Years of Service Input Value Validation.This formula applies a validation on the Element Input value field depending on the Years of Service. If an employee’s length of service does not falls between a specific range then an error message is displayed.One can found this Formula using the following Navigation:
Login To Application (with appropriate credentials) -> Navigator -> Setup And Maintenance -> Manage Fast Formula -> Search for Fast Formula ( Severance Payments Years of Service Input Value Validation)
Fast Formula Text:
default for ENTRY_VALUE is 0 inputs are entry_value (number) l_entry_value = entry_value if l_entry_value <= 0 or l_entry_value > SEVERANCE_PAYMENTS_MAXIMUM_YEARS_OF_SERVICE then ( FORMULA_STATUS = 'E' FORMULA_MESSAGE = GET_MESG('HRX', 'HRX_CNPCT_INV_SEV_PAY_YOS', 'MIN_VALUE', to_char(SEVERANCE_PAYMENTS_MINIMUM_YEARS_OF_SERVICE), 'MAX_VALUE', to_char(SEVERANCE_PAYMENTS_MAXIMUM_YEARS_OF_SERVICE)) return FORMULA_STATUS, FORMULA_MESSAGE ) l_entry_value = l_entry_value * 2 if l_entry_value <> trunc(l_entry_value) then ( FORMULA_STATUS = 'E' FORMULA_MESSAGE = GET_MESG('HRX', 'HRX_CNPCT_INV_SEV_PAY_YOS', 'MIN_VALUE', to_char(SEVERANCE_PAYMENTS_MINIMUM_YEARS_OF_SERVICE), 'MAX_VALUE', to_char(SEVERANCE_PAYMENTS_MAXIMUM_YEARS_OF_SERVICE)) return FORMULA_STATUS, FORMULA_MESSAGE ) FORMULA_STATUS = 'S' return FORMULA_STATUS |