Plat-Dev-201 practice question 17 of 30
A developer has the following requirements: • Calculate the total amount on an Order. • Calculate the line amount for each Line Item based on quantity selected and price. • Move Line Items to a different Order if a Line Item is not in stock. Which relationship implementation supports these requirements on its own?
Full set: 204 questionsThe requirements necessitate a relationship that supports both roll-up summary fields and the ability to re-parent child records. A master-detail relationship is required to create roll-up summary fields, which can calculate the total amount on the Order from its Line Items. A standard master-detail relationship locks the child record to the parent, but enabling the "Allow reparenting" option on the relationship field allows a child Line Item to be moved to a different parent Order. This single relationship type fulfills all stated requirements.
B. A lookup relationship does not support roll-up summary fields, failing the requirement to calculate the total amount on the Order.
C. This inverts the object relationship. An Order having a lookup to a Line Item is illogical for a sales model.
D. This inverts the object relationship, making the Order a child of the Line Item, which is functionally incorrect for this scenario.
1. Salesforce Help, Object Relationships Overview. "Master-Detail" section: "The master-detail relationship is a strongly coupled relationship... It also allows you to create roll-up summary fields."
2. Salesforce Help, Create a Master-Detail Relationship. Step 7 describes the "Allow reparenting" option: "Select Allow reparenting to allow a child record in a master-detail relationship to be reparented to a different parent record."
3. Salesforce Object Model and Custom Objects, Trailhead. "Understand Relationship Fields" unit.
Keep practicing
Take the free Plat-Dev-201 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other Plat-Dev-201 practice questions
- Question 1Which three steps allow a custom Scalable Vector Graphic (SVG) to be included in a Lightn…
- Question 2Which two statements are true about using the @testSetup annotation in an Apex test class…
- Question 3Managers at Universal Containers want to ensure that only decommissioned containers are a…
- Question 4Universal Containers has a Visualforce page that displays a table of every Container__c b…
- Question 5A developer is alerted to an issue with a custom Apex trigger that is causing records to …
- Question 6Which two operations affect the number of times a trigger can fire? Choose 2 answers
