I have the following entities:
<complexType name="Account">
..
<element name="Account__r" nillable="true" minOccurs="0" type="tns:QueryResult" />
...
...
<complexType name="Address__c">
..
<element name="Account__c" nillable="true" minOccurs="0" type="tns:ID" />
<element name="Account__r" nillable="true" minOccurs="0" type="ens:Account" />
I need to retrieve all the address of Account, given Address__c I can retrieve the accounts (SELECT Name,Account__r.Name, Account__r.AccountNumber FROM Address__c), but I need to pull all the addresses__c for each account.
So if one Account has not associated to any Address__c entries I want to show it in the results regardless.
How can I do that?
You can use a SOQL-R child select to fetch the related addresses, e.g.
select id,name,accountNumber, (select id, name from account__r) from account