function readOnly(count){ }
Don't have an account?
Search for an answer or ask a question of the zone or Customer Support.
You need to sign in to do that
Sign in to start searching questions
Signup for a Developer Edition
Sign in to start a discussion
<apex:page standardController="Account" recordSetVar="accounts" tabstyle="account" sidebar="false"> <apex:pageBlock > <apex:repeat value="{!accounts}" var="a"> <apex:pageBlockSection title="{!a.name}"></apex:pageBlockSection> <apex:relatedList list="Contacts" subject="{!a.Id}"/> </apex:repeat> </apex:pageBlock> </apex:page>
SELECT Id, Name, (SELECT Id FROM Contacts) FROM Account
List<Account> lstAccount = [ SELECT Id, Name, (SELECT Id,LastName FROM Contacts) FROM Account ]; For( Account acc : lstAccount ) { List<Contact> lstCont = acc.Contacts; For(Contact cont : lstCont ) { System.debug('------------------>Cont---->'+cont.LastName); } }
If you are looking for a SOQL then beloq query should work for you.
[SELECT Id, Name, (SELECT Id FROM Contacts) FROM Account]
You may modify the above query to include your columns of interest along with filter (where clause).
For SOQL you can try below query
For Apex code like below
Let us know if you need more information