Choosing and configuring the right relationship between two objects is one of the most common data-model decisions for Salesforce admins. The walkthrough below covers the standard sequence for designing and creating a relationship, with guidance for choosing among Lookup, Master-Detail, and the alternatives.
- Decide which relationship type fits the use case
Answer four questions about the relationship: can the child exist without the parent (yes implies Lookup, no implies Master-Detail), should deleting the parent delete the child (yes implies Master-Detail), should the child inherit the parent's sharing (yes implies Master-Detail), and does the child need its own Owner field (yes implies Lookup). For most scenarios, Lookup is the right default; choose Master-Detail only when the child is genuinely a sub-component of the parent.
- Create the relationship field in Object Manager
From Setup, open the child object in Object Manager. Click Fields and Relationships and then New. Choose the field type (Lookup Relationship or Master-Detail Relationship). Configure the field: label, API name, parent object, child relationship name (used in SOQL queries), and any field-specific options (required at form level, cascade delete for Lookup, reparenting allowed for Master-Detail). Add a description that explains the business meaning. Save and assign the field to the relevant page layouts.
- Configure lookup filters and validation
If the relationship should restrict which parent records can be selected, add a Lookup Filter that constrains the parent picker. The filter can reference parent record fields, runtime user fields, or custom logic. Add any validation rules that should fire when the relationship is set or changed. Test the configuration in a sandbox: try to create a child record with various parent values, including invalid ones, and confirm the filter and validation behave correctly.
- Update reports, page layouts, and automation
Add the new relationship to relevant report types so reports can use the cross-object data. Update child record page layouts to expose the parent record's information prominently. Update parent page layouts to add the related list showing the new child object. Audit existing automation (Flow, Apex triggers) for places where the new relationship should drive behavior, and update accordingly. Test end-to-end in sandbox before deploying to production.
Both objects must exist before the relationship can be created. Either standard or custom objects work.
The unique field identifier on the child object that holds the parent reference.
Lookup, Master-Detail, External Lookup, or Indirect Lookup, based on the use case.
The SOQL traversal name used to query children from the parent.
Required to create relationship fields in Setup.
- Master-Detail is hard to convert to Lookup after records exist. Choose Lookup as the default unless you specifically need cascade-delete and sharing inheritance.
- Master-Detail relationships do not have their own Owner field; the child inherits the parent's owner. This sometimes surprises admins coming from other databases.
- Roll-Up Summary fields only work on Master-Detail relationships, not Lookup. If you need cross-object aggregation on a Lookup, you need an Apex trigger or a Flow to maintain the rolled-up field.
- Lookup Filters run on every save and lookup. Complex filter logic can slow down record creation; keep filters as simple as possible.
- Many-to-many relationships through junction objects require a custom object with two Master-Detail fields. Both ends have full cascade-delete impact on the junction.