Cert++
Close

Junction object primary master effects

Key Takeaway

The first master-detail relationship you create on a junction object becomes the primary one, and it controls the junction record's look, inherited owner and inherited division.

A junction object is a custom object with two master-detail relationships. You use it to model a many-to-many relationship, which lets each record of one object link to many records of another object, and the reverse. For example, a Bug can relate to many Cases, and a Case can relate to many Bugs. One master is primary and the other is secondary, and that difference affects pages, ownership, divisions and reports.

How to create a junction object

Creating a many-to-many relationship requires the "Customize Application" permission.

  1. Create the custom object that will be your junction object. Salesforce recommends a label that shows its purpose, such as BugCaseAssociation, and the auto-number data type for the Record Name field.
  2. Don't launch the custom tab wizard before you click Save, because junction objects don't need a tab.
  3. On the junction object, create the master-detail relationship to the object you want as primary before you create the other one. Creation order decides which master is primary, so this first relationship becomes the primary relationship. Its object is the primary master object.
  4. Create the master-detail relationship to the other object. This second relationship becomes the secondary relationship, and its object is the secondary master object.

A custom object can have up to 2 master-detail relationships, so a junction object has no room for a third master-detail relationship. Each relationship also counts toward the object's maximum number of custom fields.

Platform App Builder Study Guide

Checklist progress

0/340Learned

Given a scenario, explain the capabilities of the various relationship types and the implications of each on record access, user interface, and reporting.

0/14

Prepare for the Exam

Play Today's Certle

Study Community

Ask questions and get the latest info from other Platform App Builder studiers. 757 members and growing.