Salesforce Platform Developer I (legacy) — Question 188

A developer working on a time management application wants to make total hours for each timecard available to application users. A timecard entry has a Master-
Detail relationship to a timecard.
Which approach should the developer use to accomplish this declaratively?

Answer options

Correct answer: B

Explanation

The correct answer is B because a Roll-Up Summary field is specifically designed to aggregate data from related records in a Master-Detail relationship, making it the most efficient way to calculate total hours from timecard entries. Option A requires manual calculations and displays, which is less efficient. Option C uses Process Builder, which is not as direct for this purpose, and option D involves Apex coding, which is not a declarative solution.