Purpose
When writing SOQL queries that include parent-to-child relationships, such as querying child records from a parent (e.g., Opportunities → Quote__r), you need the Child Relationship Name — not just the field name.
What is the Relationship Name?
The Relationship Name is used in SOQL subqueries to refer to a set of child records related to a parent record. It is not the same as the field name that links the child to the parent.
For example:
Field Name: Opportunity__c (on a custom object)
Child Relationship Name: CustomObject__r (used in SOQL)
Steps to Find the Child Relationship Name
- Log into Salesforce and go to Setup.
- Click on Object Manager at the top of the page.
- Search for and select the child object (the object that has the lookup or master-detail relationship).
- Click on Fields & Relationships in the left-hand menu.
- Find the lookup or master-detail field that references the parent object (e.g., Opportunity__c).
- Click on the field name to open the field details.
- Scroll down and look for the field "Child Relationship Name".
- You’ll see something like:
Child Relationship Name: CustomObjects__r
Note
- ClientPoint will automatically add the "__r" suffix to the Child Relationship Name entered into the "Relationship Name" field mapping column in ClientPoint.
- Child Relationship Names are case-sensitive.
- f you're working with standard objects, Salesforce uses predefined child relationship names (e.g., Contacts for Account → Contact).