public class AccountRelatedContacts {
public List<Account> getAccounts(){
list<Account> displayAccounts = [select id,name,(select id,name from Contacts where accountid!=null) from Account];
return displayAccounts;
}
}
public class AccountRelatedContacts {
public List<Contact> getContacts() {
List<Contact> conresults = [Select Id,Account.Name, FirstName, LastName,Email from Contact where accountid!=null limit 30];
return conresults;
}
}
Please mark it as the best answer if it helps you.
public class AccountRelatedContacts {
public List<Account> getAccounts(){
list<Account> displayAccounts = [select id,name,(select id,name from Contacts where accountid!=null) from Account];
return displayAccounts;
}
}
Hi,
try this below code.
Please mark it as The Best Answer
Thank You
All Answers
You can take reference from below link to display related contact for a account.
http://salesforcecodes.com/display-related-contacts-of-an-account-using-visualforce-page/
Thanks!
Hi Yash,
Please find the solution. "visualforce"
Please mark it as the best answer if it helps you.
Thank you
i want to show account name as well as account contact name
and all are inn the tabular format.
so parents is account
Hi,
try this below code.
Please mark it as The Best Answer
Thank You