Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Salesforce by (13.1k points)

I have created a custom object with a name "billings" and having custom lookup field to the opportunity. So, I was trying to query all the billings records but it is throwing an error:

Unknown error parsing query

Can anyone help me with this?

1 Answer

0 votes
by (26.7k points)

In case of Nested queries in SOQL, you have to use __r for the child relationship name. You can try the below query it will help.

SELECT Id, StageName, ( SELECT Name, Email FROM Billings__r ) FROM Opportunity WHERE ID = '0011000002mfTil'

I hope this will help.

Want to become a Salesforce expert? join Salesforce certification now!!

Browse Categories

...