Developer Fundamentals27% of the exam

Data modeling: objects, relationships and external IDs

Choosing lookup, master-detail, junction, hierarchical, external lookup or indirect lookup relationships from a requirement, using external IDs for upserts, and reading schema, picklists and record types from Apex with describe calls.

Official exam objective
Given a scenario, determine, create, and access the appropriate data model including objects, fields, relationships, and external IDs.

~7 min read · 21 practice questions ·

What the exam expects

  • Pick the relationship type from a requirement: lookup, master-detail, many-to-many junction, self lookup, hierarchical, external lookup or indirect lookup.
  • Predict master-detail behaviour (required parent, cascade delete, inherited sharing, roll-ups) and the rules for converting and reparenting.
  • Design external ID fields for integrations and upserts.
  • Build and inspect the model with Schema Builder, and read objects, fields, picklist values and record types from Apex with describe.
  • Key terms: lookup (loose link, parent optional); master-detail (tight link, master controls the detail); junction object (a custom object with two master-detail relationships); external ID (a field holding another system's record identifier); describe (Apex metadata about objects and fields).

Key facts

Master-detail per object
Detail
Up to 2, within 40 total relationships
Detail record owner
Detail
No Owner field; set to the master's owner; no sharing rules, manual sharing or queues
Lookup parent deleted
Detail
Default clears the field; can block deletion instead
Master-detail to lookup
Detail
Only when no roll-up summary fields exist on the master
Lookup to master-detail
Detail
Only when every record has a lookup value
Junction primary relationship
Detail
First master-detail created; drives look and feel and owner
External ID field types
Detail
Auto-number, email, number, text; up to 25 per object
Upsert key
Detail
Indexed external ID custom field (or idLookup field on standard objects)
Hierarchical relationship
Detail
User object only
Active picklist values in Apex
Detail
getPicklistValues() then isActive() on each entry
Sources for this section (5)
  • Why can't a detail object have sharing rules?
  • When can a lookup be converted to master-detail?
  • Which relationship do you create when a Salesforce Connect object stores an ERP code that must match an Account?
  • Why describe a picklist field instead of querying records for its values?
  • Which field types can be marked as external IDs?

The questions are free to read. Answers with their sources and self-grading are included with the pack.

Keep reading with the Platform Developer pack

  • Core concepts
  • Exam traps
  • Worked scenario

The pack includes:

  • All 21 lessons of the Platform Developer guide, with reading progress
  • Interactive decision walks and step-by-step sequence steppers
  • Inline practice questions and one-click topic practice (21 questions for this lesson)
  • An official source cited for every claim
  • An AI tutor that answers from the guide
  • Unlimited timed practice exams

Practice for the Platform Developer exam