+ Start a Discussion
Varun Sinha 17Varun Sinha 17 

Need to show Contact Id related to account on a visualforce page

I need to show all the contact id related to a particular account and total number of contact related to account  so that whenever i click on a particular contact id it should redirect me to that contact page.
Can anyone help me on this.
Mudasir WaniMudasir Wani
It is better to display the contact information using related list.
Here is an example.


<!-- For this example to render properly, you must associate the Visualforce page
with a valid account record in the URL.
For example, if 001D000000IRt53 is the account ID, the resulting URL should be:


See the Visualforce Developer's Guide Quick Start Tutorial for more information. -->

<apex:page standardController="Account">
    You're looking at some related lists for {!account.name}:

    <apex:relatedList list="Contacts">
        <apex:facet name="header">Titles can be overriden with facets</apex:facet>

    <apex:relatedList list="Cases" title="Or you can keep the image, but change the text" />