Create the relationship from the child object Fields & Relationships area in Object Manager. Decide lookup or master-detail before starting; converting later is possible but disruptive.
- Open the child object in Object Manager
Setup > Object Manager > [child object name] > Fields & Relationships. Click New.
- Pick the field type
Select Lookup Relationship for loose coupling or Master-Detail Relationship for tight coupling. Click Next.
- Select the related parent object
Pick the object that should be the One side of the relationship. Click Next. The field will be created on the current (Many) object and pointed at the parent.
- Set field label, name, and behavior
Enter the field label and API name. For Lookup, choose what happens when the parent is deleted: Clear the value of this field (default), Do not allow deletion of the parent (most strict), Delete this record also (cascade). For Master-Detail, no choice; cascade is automatic.
- Configure field-level security and page layouts
Pick which profiles see the field. Add the field to relevant page layouts. Save. The relationship is live; child records can now point to parents through this field.
Loose coupling. Child can have no parent. Parent deletion does not cascade by default.
Tight coupling. Child cannot exist without parent. Cascade delete and sharing inheritance built in.
Special lookup on the User object only, pointing to another User. Used for the manager hierarchy.
Relationship from a Salesforce object to an external object (Salesforce Connect). Read-only by default.
- Master-detail fields are required and cascade-deleting. Adding one to an existing object with thousands of records requires every record to already have a value; you cannot leave any null.
- Each custom object can have at most 2 master-detail fields. If you need three, the third must be a lookup, or restructure the model with junction objects.
- Roll-up summary fields only work on master-detail relationships. Convert lookup to master-detail (or use the Declarative Lookup Rollup Summary tool) if you need aggregates.
- Standard objects have specific limits on which relationships are allowed. You cannot create a master-detail from a custom object to a User, for example. Check the Object Reference before designing.