PDI · Question #83
A developer created these three Rollup Summary fields in the custom object, Project__c: The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a
The correct answer is B. Formula field. To calculate a ratio between rejected and approved timesheets using existing rollup summary fields on Project__c, a formula field is the most efficient choice to minimize maintenance overhead.
Question
A developer created these three Rollup Summary fields in the custom object, Project__c:
The developer is asked to create a new field that shows the ratio between rejected and approved timesheets for a given project. Which should the developer use to implement the business requirement in order to minimize maintenance overhead?
Options
- ARecord-triggered flow
- BFormula field
- CApex trigger
- DField Update actions
How the community answered
(33 responses)- A9% (3)
- B42% (14)
- C33% (11)
- D15% (5)
Why each option
To calculate a ratio between rejected and approved timesheets using existing rollup summary fields on `Project__c`, a formula field is the most efficient choice to minimize maintenance overhead.
A record-triggered flow could perform this calculation and update a field, but it requires more configuration and introduces an automation layer that is unnecessary when a simple declarative formula can achieve the same result.
A formula field on the `Project__c` object can directly reference the values of existing rollup summary fields to calculate the ratio. This approach requires no code, executes automatically upon record access, and has minimal maintenance overhead as it re-evaluates dynamically.
An Apex trigger would involve writing, testing, and maintaining code, which is a higher maintenance overhead than a declarative formula field for a straightforward calculation based on existing fields.
Field Update actions are typically used within workflow rules or flows to update fields based on specific criteria, and are not a standalone mechanism for calculating a ratio based on other fields.
Concept tested: Formula Fields for calculations
Source: https://help.salesforce.com/s/articleView?id=sf.formula_fields.htm&type=5
Topics
Community Discussion
No community discussion yet for this question.