Salesforce Certified Platform Developer II — Question 171

A company has a custom object Sales_Help_Request_c that has a Lookup relationship to Opportunity. The Sales_Help_Request_c has a number field, Number_of_Hours_c, that represents the amount of time spent on the Sales_Help_Request_c.

A developer is tasked with creating a field, Total_Hours_c, on Opportunity that should be the sum of all of the Number_of_Hours_c values for the Sales_Help_Request_c records related to that Opportunity.

What should the developer use to implement this?

Answer options

Correct answer: B

Explanation

The correct answer is B, a roll-up summary field on the Opportunity object, because it allows for the automatic calculation of the total of a specific field from related records. A trigger (options A and C) would require more complex coding and is not necessary for this straightforward summation task. A workflow rule (option D) cannot perform this type of aggregation, making it an unsuitable choice.