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
GB3GB3 

Select Fields From Parent Where Child field has a certain value

Hi,

Is it possible to select parent values where the child field has a certain value?

For example:
 
Select Name
From Contract
Where Contract.Orders.Status = 'Draft'
I get the error: 

Didn't understand relationship 'Contracts' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name.  Even if I add the __r to Orders though, I get the error...


 
CloudalyzeCloudalyze
Hi,
 
select id, Contract.Id, contract.ownerId from order where Status='Draft'
You can try to query like this.

please check and let us know.
GB3GB3
Thanks.  While that works for this example, but I need to query based on the Parent table for other relationships (i.e., Contract, not Order).

Is it possible to do this query From the Contract table (or any other parent table)?