I'm struggling with a query, I want to select all Branches, and 'join' Companies (of type Account) with again the Contacts in there. Until now no luck, what am i doing wrong?
SELECT
b.Id, b.Location,
(SELECT FirstName, LastName, FROM b.Companies.Contacts
//i've tried combinations of __r and __c
WHERE City == 'New York')
FROM Branche__c b
my WSDL for this part is built up like this:
<complexType name="Branche__c"> .. <element name="Companies__r" nillable="true" minOccurs="0" type="ens:Account"/> .. </complexType> .. <complexType name="Account"> .. <element name="Contacts" nillable="true" minOccurs="0" type="tns:QueryResult"/> .. </complexType>
ERROR at Row:14:Column:24 First SObject of a nested query must be a child of its outer query.
– Bokw