Created
January 16, 2015 22:23
-
-
Save dancinllama/2bfa01a863caa128cb91 to your computer and use it in GitHub Desktop.
SOQL parent relationship query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Account> parentAccounts = new List<Account>(); | |
for(Contact contactWithAccountInfo : [Select Name,Account.Name,Account.AnnualRevenue From Contact]){ | |
System.debug('Contact Account Id: ' + contactWithAccountInfo.Account.Id); | |
parentAccounts.add(contactWithAccountInfo.Account); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment