Oracle Fast Formulas - Chapter 27: Oracle Fusion Fast Formulas – Writing Reusable Fast Formulas with Inputs

 

Chapter 27: Oracle Fusion Fast Formulas – Writing Reusable Fast Formulas with Inputs


Fast Formulas in Oracle Fusion allow flexibility through Inputs, which can be reused across multiple formulas or passed from the application during processing. This chapter covers how to define, use, and manage inputs effectively for dynamic calculations.


🔹 What Are Inputs in Fast Formulas?

Inputs are variables you define at the top of your formula that can receive values from the application (or user-defined processes). Inputs make formulas dynamic and reusable, as they don’t rely on hardcoded values.


🔧 Syntax to Declare Inputs

plsql
INPUTS ARE input_name1 (data_type), input_name2 (data_type)

✔ Supported Data Types:

  • TEXT – String values (e.g., “Y”, “Manager”)

  • NUMBER – Numeric values (e.g., 1500)

  • DATE – Date values (e.g., 01-JAN-2025)


🔄 Example

plsql
INPUTS ARE BASIC_SALARY (NUMBER), BONUS_PERCENT (NUMBER) BONUS_AMOUNT = BASIC_SALARY * BONUS_PERCENT / 100 RETURN_VALUE = BONUS_AMOUNT

This formula calculates bonus dynamically based on inputs provided from the calling payroll rule.


🔹 Why Use Inputs?

  • Flexibility – Same formula can be reused with different values.

  • Maintainability – Avoids rewriting the same formula logic multiple times.

  • Parameterization – Allows passing of user-defined values or values from configuration pages.


🔍 Where to Pass Inputs?

Inputs are passed from:

  • Elements (e.g., Earnings/Bonuses)

  • Eligibility Rules

  • Payroll Definitions

  • Compensation Plan Rules

In the element definition, map input names to input values.


📌 Note:

Input names in your formula must exactly match what you configure in the application interface, otherwise values will not pass through.


📂 Example Use Case: Annual Leave Formula

plsql
INPUTS ARE LEAVE_BALANCE (NUMBER), LEAVE_TAKEN (NUMBER) REMAINING_LEAVE = LEAVE_BALANCE - LEAVE_TAKEN RETURN_VALUE = REMAINING_LEAVE

You can use this formula for multiple employees by simply passing in different balances and leave taken values.


📘 Best Practices

Tip #Recommendation
1Use clear, descriptive names for inputs
2Always check input availability via test formula
3Include fallback values using default logic if input is missing
4Document expected input values clearly for non-technical users

📝 Mini Quiz

1. What is the correct way to declare two inputs in Fast Formula?
a) INPUTS ARE (value1, value2)
b) DEFINE INPUT value1, value2
c) INPUTS ARE salary (NUMBER), tax (NUMBER)
d) INPUTS salary (TEXT)

✅ Answer: c) INPUTS ARE salary (NUMBER), tax (NUMBER)

2. What happens if input names do not match between formula and configuration?
a) Formula uses default value
b) Formula errors or returns incorrect result
c) System overrides with zero
d) Input is ignored

✅ Answer: b) Formula errors or returns incorrect result

No comments:

Post a Comment