To query related child records in a lookup or master-detail relationship:
Use the parent object (Gym__c) to retrieve its child records (Trainer__c) through a nested query.
The child relationship name (Trainers__r) is derived from the lookup field.
[Reference:SOQL Relationships, , ]
Contribute your Thoughts:
Chosen Answer:
This is a voting comment (?). You can switch to a simple comment. It is better to Upvote an existing comment if you don't have anything to add.
Submit