+ Start a Discussion

Relation Ship Queries in Salesforce



   Can any body give me one Example on Nested Queries. I am getting error while writing Nested Queries.See Following query i am getting error while typing.


public class nestedqueryexample
public List<Account> getaccsandtmember()
List<Account> accounts = [Select Id,(Select TeamMemberRole, User.Name From Account.AccountTeamMembers), Name, BillingCountry from Account];
return accounts;





Enable your Account Team Setup.


Go to Set up -> Click on Customize -> Click on Account -> Click on Account Team -> Click on Enable -> Select the Page layout.

-> Click on save.


After this Run your query.



Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.