LogoClawIndex
CasesSkillsAbout
LogoClawIndex

apex-soql-relationship-queries - Query Salesforce relationships safely in Apex

Write and debug Apex SOQL relationship queries using dot notation, subqueries, polymorphic TYPEOF clauses, aliases, and safe child-record access.

Tags

Updated: 2026-11-29

Capabilities

Typical Inputs

Typical Outputs

What this skill does

  • Traverse parent fields
  • Query child records
  • Handle polymorphic lookups
  • Filter with aliases
  • Guard child collection access
  • Choose query strategies

Inputs

  • Object names and relationship direction
  • Polymorphic lookup fields
  • Class API version
  • Query execution context
  • Expected child-record count per parent

Outputs

  • Correct SOQL relationship query
  • Selector method and safe child access code
  • TYPEOF clause with WHEN branches
  • Relationship-shape test class

Requirements

  • Salesforce Spring '25 or later

Source

  • Spec: SKILL.md

ClawIndex

OpenClaw Skills & Use Case Index

ClawIndex is an ecosystem-driven index of OpenClaw skills and real-world use cases.

Index

Skills·
Cases

Meta

About·
Disclaimer·
Email·
GitHub
© 2026 ClawIndex All Rights Reserved.
apex
soql
relationship-queries
child-to-parent
parent-to-child
polymorphic
typeof
subquery
alias-notation
Traverse parent fields
Query child records
Handle polymorphic lookups
Filter with aliases
Object names and relationship direction
Polymorphic lookup fields
Class API version
Correct SOQL relationship query
Selector method and safe child access code
TYPEOF clause with WHEN branches