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
ananga sen 5ananga sen 5 

custom object (child) and stand obj (parent )query

I have CustomObjB which has lookup to user. I want to query on user and need to fetch the related child i.e. customobjb record.
I tried with plural form but its showing  "Unknown error parsing query" as blank spaces are there in the plural form.
How can i query ?
ss
User-added imageUser-added imageUser-added image
Balagopal GBalagopal G

Hi ,

You need to use Object API Name.

Change your query to following:-

select id,name,(select id,name from CustomObjB__c) from user.

 

* Note- It will through error if the relationship between CustomObjB__c and user is mentioned wrong in the query.

 

AMIT AGRAWAL 5AMIT AGRAWAL 5

Hi ,

You need to update soql query child object relationship name like this.

select id,name,(select id,name from CustomObjB__r) from user.
 
Thanks,
Amit