Salesforce Platform Developer I (legacy) — Question 45

An org tracks customer orders on an Order object and the line items of an Order on the Line Item object. The Line Item object has a Master/Detail relationship to the Order object. A developer has a requirement to calculate the order amount on an Order and the line amount on each Line Item based on quantity and price.
What is the correct implementation?

Answer options

Correct answer: C

Explanation

The correct answer is C because using a numeric formula field for the line amount allows real-time calculation based on quantity and price, while a roll-up summary field efficiently aggregates the line items' amounts to calculate the order total. The other options, while potentially functional, do not leverage Salesforce's features as effectively for this specific requirement.