Salesforce Platform Developer I (legacy) — Question 16
The operation manager at a construction company uses a custom object called Machinery to manage the usage and maintenance of its cranes and other machinery. The manager wants to be able to assign machinery to different constructions jobs, and track the dates and costs associated with each job. More than one piece of machinery can be assigned to one construction job.
What should a developer do to meet these requirements?
Answer options
- A. Create a lookup field on the Construction Job object to the Machinery object.
- B. Create a lookup field on the Machinery object to the Construction Job object.
- C. Create a junction object with Master-Detail Relationship to both the Machinery object and the Construction Job object.
- D. Create a Master-Detail Lookup on the Machinery object to the Construction Job object.
Correct answer: C
Explanation
The correct answer is C because a junction object is necessary to create a many-to-many relationship between the Machinery and Construction Job objects, allowing multiple pieces of machinery to be assigned to multiple jobs. Options A and B only establish one-way relationships, which do not satisfy the requirement of tracking multiple machinery per job. Option D also does not create the required many-to-many relationship.