Chapter 8: Contexts in Fast Formulas
Objective of This Chapter
This chapter explains Contexts in Oracle Fusion Fast Formulas — what they are, how they work, and how to use them smartly in your formulas.
What are Contexts
Contexts are automatic inputs available to your formula based on the environment it is running in.
They provide extra dynamic information without needing manual inputs.
Contexts help formulas behave differently depending on person, assignment, payroll, or other conditions.
How Contexts Work
When you run a formula, Fusion automatically passes some environment-specific values like:
Context Name | Meaning |
---|---|
ASSIGNMENT_ID | Assignment ID of the employee |
EFFECTIVE_DATE | Effective date of calculation |
BUSINESS_GROUP_ID | Business Group linked to employee |
PAYROLL_ID | Payroll record being processed |
You can access these contexts in your formula just like normal variables.
Setting Contexts Explicitly
In case your formula needs to ensure a context is available, you can declare it using:
This makes the formula more controlled.
Example of Using Contexts
Suppose you want to calculate a bonus only for employees assigned to a particular payroll:
Here, the formula reads payroll_id
automatically without passing it as an input.
Types of Common Contexts
Type | Example Fields |
---|---|
Assignment | assignment_id, job_id |
Payroll | payroll_id, effective_date |
People | person_id, person_number |
Others | legislation_code, business_group_id |
Important Rules
Rule | Reason |
---|---|
Always use CHANGE CONTEXTS to declare | To make your formula clean and explicit |
Validate context values | Avoid unexpected errors |
Understand which module gives which context | Payroll, Absence, Benefits, etc. |
Benefits of Using Contexts
Reduces the number of manual inputs.
Makes formulas more dynamic.
Improves performance because system data is directly used.
Easier maintenance when business logic changes.
Simple Practical Example
Bonus calculation based on Job:
Mini Practice Quiz
What keyword is used to mention that a context will be used?
A CONTEXTS
B CHANGE CONTEXTS ARE
C ENVIRONMENT
Answer: B CHANGE CONTEXTS ARE
Which of these is an example of a context?
A salary
B assignment_id
C bonus
Answer: B assignment_id
True or False: Contexts need to be passed manually every time.
Answer: False
No comments:
Post a Comment