Skip to main content The Trailblazer Community will be unavailable from 2/1/2025 to 2/2/2025. Please plan your activities accordingly.
Dear All,

I would like to retrive the data from Lookup Relationship Object A1 and Child Object Data of B2 fields 

Example:  Account --Object Name

                   Main Contact: Lookup Name

                   Contact Object is Havng child Relationship with Country Object

Now my Question is I would liket o Fetch Account fields Data, Contacts Field Data and Country Object Field Data

Here is my planned query:

Select Name, MainContact__r.Country__r.Name FROM Account__c

as per my above query its not allowing me to write lookup to child object relationship

Can some one help me?

Thanks & Regards,

 
7 answers
  1. Jun 23, 2015, 2:49 AM

    Dear Shrikant,

    Hope you are doing well!

    a bit confusing what do you mean by "Contact__r" is this Lookup relationship Name of the field MainContact__c or its Contact Objact relationship name?

    Account__c is Master Object---MainContact_c is the lookup field of Contact__c Object under the conact Object i have child relationship of Country__c Object 

    Now i need to get the field data of all the object |Account__c |Contact__c|Country__c|

    How do you want met o query

    Thanks & Regards,
Loading
0/9000