Вы находитесь на странице: 1из 12

Examples of Oracle FastFormula

Copyright 2007, Oracle. All rights reserved.


Element Entry Validation Formulas

About validation formulas:


You can validate element entries by min or max
values, a lookup, or a formula.
Validation formulas are called by the Element Entry
API, so entries made from any interface can be
checked.
You must define the validation formula before you
define the element or user table.

Copyright 2007, Oracle. All rights reserved.


Writing Validation Formulas

One input value called ENTRY_VALUE

INPUTS ARE ENTRY_VALUE(text)

One or two return values called FORMULA_STATUS or


FORMULA_MESSAGE (optional)

RETURN (FORMULA_STATUS, FORMULA_MESSAGE)

Copyright 2007, Oracle. All rights reserved.


Writing Validation Formulas

FORMULA_STATUS must be s (success) or e (error)

ELSE
FORMULA_STATUS = s

You cannot use an elements other pay and input


values in the formula.

Copyright 2007, Oracle. All rights reserved.


Example Validation Formula

INPUTS ARE ENTRY_VALUE(text) Single input value


IF TO_NUM(ENTRY_VALUE) > 200000
THEN
(
FORMULA_STATUS = e
FORMULA_MESSAGE = Too much money--try
again
)
ELSE
One or two
FORMULA_STATUS = s return values
RETURN (FORMULA_STATUS, FORMULA_MESSAGE)

Copyright 2007, Oracle. All rights reserved.


Conversion Functions

About conversion functions:


All element entry values are stored in the database
as text.
Before validating an entry value as a number or
date, you must convert it.

Copyright 2007, Oracle. All rights reserved.


Using Conversion Functions

Format:

TO_NUM(entry_value)

TO_DATE(entry_value, YYYY/MM/DD HH24:HH:MI)

Example:
IF (ACP_START = 'BOY') THEN
(
First_Eligible_To_Accrue_Date =
to_date('01/01/'||to_char(add_months
(Continuous_Service_Date, 12), 'YYYY'),
'DD/MM/YYYY')
)

Copyright 2007, Oracle. All rights reserved.


QuickPaint Reports

QuickPaint is a tool for designing reports about


assignments.
When you define QuickPaint Reports a formula is
generated automatically.

Copyright 2007, Oracle. All rights reserved.


QuickPaint Formulas

About QuickPaint formulas:


Formulas generated from QuickPaint do not include
conditional logic or calculations
You can edit the generated formulas to add:
Calculations to sum element input values
An IF statement to report different data for different
groups of assignments

HINT: Always keep a copy of your edited formula

Copyright 2007, Oracle. All rights reserved.


Assignment Sets

Assignment Sets are used for:


Processing subsets of employees in payroll runs
Defining a group of assignments for reporting
Entering the same batch line against a group of
assignments

When you define Assignment Sets, a formula is


generated automatically.

Copyright 2007, Oracle. All rights reserved.


Assignment Set Formulas

About Assignment Set Formulas:


You wont normally need to edit these formulas
You might edit brackets to change the order in which
conditions are tested

Copyright 2007, Oracle. All rights reserved.


Assignment Set Formulas

Example:

GRADE = A OR (GRADE = B AND JOB = MANAGER)

Change to:

(GRADE = A OR GRADE = B) AND JOB = MANAGER

Copyright 2007, Oracle. All rights reserved.

Вам также может понравиться