Sample lesson · Reading this preview does not record completion or assessment evidence.
Checkpoint + Design · 3 minutes · sample
Lookup vs Master-Detail
Choose a relationship that matches the business lifecycle.
Learning objective
Explain a relationship choice using record independence and deletion behavior.
Before you start
Know what an object, field and record represent.
Real-world scenario
A team tracks projects and their line items. Decide whether a line item should survive removal of its project.
The concept
A lookup connects records. A master-detail relationship makes the detail dependent on its master, including access and cascade deletion. Review the specific object and field settings before choosing.
Start with the lifecycle requirement, then inspect the relationship field in Object Manager.
Illustrative master-detail option; the relationship field lives on the line item.
1.Project (master)
2.Line item (detail)
- Project (master) connects to Line item (detail): One project has many line items; deleting the master deletes its details.
Read the parent reference
soql
SELECT Id, Project__c
FROM Project_Line__c
LIMIT 10Illustrative custom API names; these objects and fields must exist in the org.
Read a parent field
soql
SELECT Id, Project__r.Name
FROM Project_Line__c
LIMIT 10A relationship query alone does not establish whether the field is lookup or master-detail. Inspect its metadata.
Common mistake
Choosing a relationship from the screen layout without checking deletion behavior.
Interview angle
What would you clarify before choosing a relationship? Ask whether child records must remain independently available.
Pause and apply
Describe how your choice changes if line items must survive project deletion.
Official references
Reviewed 2026-09-22. Examples are illustrative; no code is executed here.
Key takeaways
- Start with lifecycle requirements.
- Confirm relationship settings before relying on deletion behavior.