What should a developer do to allow their code to move some existing Orderltem records to a new Order record?

A developer created a custom order management app that uses an Apex class. The order is represented by an Order object and an Orderltem object that has a master-detail relationship to Order. During order processing, an order may be split into multiple orders.

What should a developer do to allow their code to move some existing Orderltem records to a new Order record?
A . Create a junction object between OrderItem and Order.
B . Select the Allow reparenting option on the master-detail relationship.
C . Change the master-detail relationship to an external lookup relationship.
D . Add without sharing to the Apex class declaration.

Answer: B

Explanation:

To allow moving existing OrderItem records to a new Order record in a master-detail relationship:

Option B: Select the Allow reparenting option on the master-detail relationship.

Enabling "Allow reparenting" on the master-detail field allows child records (OrderItem) to be reparented to a different master record (Order). Steps:

Go to the master-detail field on OrderItem.

Edit the field and select "Allow reparenting".

Reference: "To allow reparenting of the detail records, select ‘Allow reparenting’ in the master-detail relationship field definition."

― Salesforce Help: Define Master-Detail Relationships Why Other Options Are Incorrect:

Option A: A junction object is unnecessary since the relationship already exists.

Option C: Changing to an external lookup would not solve the problem and may introduce issues.

Option D: Adding without sharing does not affect the ability to reparent records in a master-detail relationship.

Latest DEX-450 Dumps Valid Version with 456 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments