function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ratheven SivarajahRatheven Sivarajah 

I am trying to display all the phone, firstname, lastname number from related list of contact

Hey everyone, I am new to saleforce. I have a question I am trying to grab the firstname, lastname and phone from the related list of contacts and display it on a visualforce page but I have 2 errors
1:duplicate value found: duplicate value on record with id
2:unknown property AccountController.contacts

------------Apex class----------
public class AccountController {
    public List<Contact> AccountSummaryController(){
    List<Contact> conresults = [Select Id, FirstName, LastName,Title,Email from Contact where accountid='001Dn0000087GegIAE'];
    return conresults;

----------visualforce page--------
<apex:page  controller="AccountController">
        <apex:pageBlock title="Contacts List" id="contacts_list">
        <apex:pageBlockTable value="{! contacts }" var="ct">
        <apex:column value="{! ct.FirstName }"/>
        <apex:column value="{! ct.LastName }"/>
        <apex:column value="{! ct.Title }"/>
        <apex:column value="{! ct.Email }"/>

Thank you in advance
Best Answer chosen by Ratheven Sivarajah
AnkaiahAnkaiah (Salesforce Developers) 
Hi Ratheven,

Refer the below link have solution for similar kind of ask.

If this helps, Please mark it as best answer.