function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hari N 20Hari N 20 

Single SOQL Query

Hi All,
I have one custom object under account related list.

How to retrieve that custom object fields using single SOQL query? 
Naveen DhanarajNaveen Dhanaraj
Try this
[Select Id, Name, (Select Id, Name From Custom _Object__r) From Account__c];

Hari N 20Hari N 20
I dont want to use multiple objects in SOQL query.
Can we do like that?
Naveen DhanarajNaveen Dhanaraj
  1. If you have relationship between objects then only we can have related list in other object.
  2. As well as  field dispalyed in related list also based on relationships.
  3. without relationships I dont think so this possible.