An administrator needs to create a field on the Account object that calculates the number of days since the last contact with the client. The value must update automatically. Which field type is most appropriate?
Trap 1: Roll-up Summary field
Roll-up Summary fields are restricted to master-detail relationships and perform aggregations like COUNT, SUM, MIN, or MAX. They cannot perform date-based arithmetic or compare record fields against the current system date, making them unsuitable for calculating the elapsed time since a specific date value on a single record.
Trap 2: Number field populated by a Flow
While a Flow could update a number field, it is not the most efficient solution here. Flows are triggered by events and might not update accurately if the underlying date changes but no record change event occurs. A Formula field is declarative and updates instantly whenever the record is viewed.
Trap 3: Text field updated by a Validation Rule
Validation Rules are used to restrict record saving if data quality requirements are not met; they cannot be used to calculate or populate values into fields. Using a text field would require manual intervention or external automation, which contradicts the requirement for an automated and self-updating value.
- A
Roll-up Summary field
Why it fails: Roll-up Summary fields are restricted to master-detail relationships and perform aggregations like COUNT, SUM, MIN, or MAX. They cannot perform date-based arithmetic or compare record fields against the current system date, making them unsuitable for calculating the elapsed time since a specific date value on a single record.
- B
Number field populated by a Flow
Why it fails: While a Flow could update a number field, it is not the most efficient solution here. Flows are triggered by events and might not update accurately if the underlying date changes but no record change event occurs. A Formula field is declarative and updates instantly whenever the record is viewed.
- C
Formula field
Formula fields are designed to derive values from other fields or system functions like TODAY() or NOW(). They are read-only to users and update automatically whenever the record is accessed, providing the most reliable and maintenance-free way to represent calculated data points like the duration of time.
- D
Text field updated by a Validation Rule
Why it fails: Validation Rules are used to restrict record saving if data quality requirements are not met; they cannot be used to calculate or populate values into fields. Using a text field would require manual intervention or external automation, which contradicts the requirement for an automated and self-updating value.