Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
Full Child Relationship entry
How-to guide

How to use Child Relationships effectively

Child Relationships are mostly automatic. The work is naming them well and using them correctly in code and reports.

By Dipojjal Chakrabarti · Founder & Editor, Salesforce DictionaryLast updated May 20, 2026

Child Relationships are mostly automatic. The work is naming them well and using them correctly in code and reports.

  1. Set Child Relationship Names at field creation

    When creating a lookup or master-detail field, set the Child Relationship Name to something readable. Defaults work but customisation pays off for life.

  2. Use SOQL subqueries to walk children

    For parent-to-child queries, use the subquery syntax: SELECT Id, (SELECT Id FROM Cases) FROM Account. The relationship name in parentheses is the Child Relationship Name.

  3. Access children in Apex through the relationship name

    account.Cases returns the list of Cases from a subquery. The name matches the Child Relationship Name set on the field.

  4. Inspect relationships through Schema Builder

    When unsure of a relationship name, open Schema Builder and click the field. The Child Relationship Name appears on the field properties.

  5. Customise self-referencing relationships

    Self-referencing lookups (ParentId on Account) need explicit naming. The platform default is rarely readable; rename to something clear like ChildAccounts.

Gotchas
  • Default Child Relationship Names with awkward numbering confuse developers. Rename at field creation.
  • SOQL subqueries error on non-existent relationship names. Inspect through Schema Builder if uncertain.
  • Deep subqueries can return huge child lists and hit governor limits. Filter the subquery or use separate queries for large data sets.
  • Polymorphic relationships (Task.WhatId) expose Child Relationship names per parent object. Apex code needs care to handle the parent type appropriately.

See the full Child Relationship entry

Child Relationship includes the definition, worked example, deep dive, related terms, and a quiz.