Chapter 13: Working with Global Variables and Contexts in Fast Formulas
🎯 Objective of This Chapter
This chapter will teach you how to use global variables and context variables in Oracle Fusion Fast Formulas to make formulas dynamic, reusable, and capable of adapting to different processing environments.
🧠 What Are Global Variables?
Global variables are predefined keywords or data that are accessible across formulas. They help you:
-
Retrieve values like legislative data group (LDG), effective dates, payroll IDs
-
Write conditionally responsive formulas
-
Ensure formulas adapt to system-wide configurations
Commonly Used Global Variables
Variable Name | Description |
---|---|
GLOBAL_CONTEXT.LEGISLATIVE_DATA_GROUP_ID | Legislative group ID for current run |
GLOBAL_CONTEXT.ASSIGNMENT_ID | Assignment ID in current process |
GLOBAL_CONTEXT.EFFECTIVE_DATE | Effective date for current calculation |
🧠 What Are Context Variables?
Context variables are inputs passed by the Oracle Fusion system based on the environment where the formula is used (e.g., Payroll, Compensation, Benefits).
They allow you to:
-
Detect current assignment
-
Respond to payroll frequency
-
Adjust logic based on plan or element
Setting Context in Fast Formulas
Before using a context variable, it must be declared:
Example:
💡 Example: Using Context and Global Variables
Scenario:
Apply different salary calculations based on legislative group.
Code Snippet:
Explanation:
This formula checks the LDG and assigns a bonus accordingly.
✅ Best Practices
-
Always assign default values to context/global variables.
-
Use context to control logic without multiple formulas.
-
Test formula outputs under different contexts.
🔁 Real-World Use Case
You can use context variables to define different behaviors in:
-
Payroll Processing
-
Compensation Management
-
Absence Calculation
-
Benefits Eligibility
📝 Mini Practice Quiz
-
What is the purpose of global variables in Fast Formulas?
👉 To access system-wide values like LDG, Assignment ID. -
What should you always provide to a context variable?
👉 A default value. -
Can context variables be reused in different formula types?
👉 Yes, but they must be declared appropriately.
No comments:
Post a Comment