+ Start a Discussion
DokerDoker 

SOQL relation

How to write some inner query like that (this one gives an error)

Code:
select
Status__c,
Approved_Amount__c,
(select firstName from cc.MDF__r.account__r.Contacts where MySpecificValue = true )
from SFDC_MDF_Claim__c cc where id in :ids

 

RickyGRickyG
Doker -

Think you have the SOQL wrong.  You have
select firstName from cc.MDF__r.account__r.Contacts where MySpecificValue = true 
You have to point to an object in the FROM clause so it should be something like
select cc.MDF_r.account_r.Contact.firstName from SFDC_MDF_Claim__c cc where MySpecificValue = true 
Hope this helps.
DokerDoker
But there can be more than on contact for each account, where of course i have only one good match for each.