You need to sign in to do that
Don't have an account?
Prakash@SFDC
How can we query Parent's Lookup Object fileds from Child Object
Hi,
I have a requirement like query the child object and throught this query we have to get the values of another object which is a lookup to its parent. In this case PartnerLocation is the Child to Account and Opportunity is the Lookup to Account.
Thanks in Advance
Prakash.N
The easiest way would be to query the Account object from PartnerLocation then do another query from Opportunity with your Account in the WHERE clause. This could return multiple Opportunities, so you'll need some other criteria to pick the right one.
Hi Tony thanks for your reply,
Can we write it as a single query (inner query) ?i Because i need to pass the result to Java Script function in the VF page .
I am giving some sample code below....
SELECT Account.Id, Amount, Name, Account.Account_Subtype_M__c, StageName, Primary_Technology__c,( select Account.Latitude__c, Account.Longitude__c from Opportunity.Account.Partner_Locations__r Limit 1), Account.BillingStreet, Account.BillingCity, Account.BillingCountry FROM Opportunity.
I am not sure whether it is correct or not . In this i am quering oppurtunity in which i am including an innerquery on child through Account.
Prakash