You need to sign in to do that
Don't have an account?
Anuja
Problem while Diplaying contacts
Hi,
I want to display Contacts in visualforce page.
I am selecting an account through lookup field and after selcetion i want to display related contacts.
How should i do this?
Can anybody help.
Thanks,
Anuja
Hi Anuja,
You can get the result through the following code:
<apex:page standardController="Account">
<apex:detail subject="{!Account.Id}" />
<apex:relatedList list="Contacts" />
</apex:page>
make sure id of account record should be in request parameter.
like if page name is "Test" then URL should be :
https://c.na8.visual.force.com/apex/Test?id=accountId
All Answers
Hi Anuja,
You can get the result through the following code:
<apex:page standardController="Account">
<apex:detail subject="{!Account.Id}" />
<apex:relatedList list="Contacts" />
</apex:page>
make sure id of account record should be in request parameter.
like if page name is "Test" then URL should be :
https://c.na8.visual.force.com/apex/Test?id=accountId
Hi,
Thanks for reply.
I am using account as a standard controller as i want to diplay list of accounts.
after selecting one account i wanted to display related contacts for that perticular account.
my VF page is -
<apex:page standardcontroller="contact">
<apex:form >
<apex:pageBlock >
<apex:outputText value="Account Name : " />
<apex:inputField value="{!contact.accountid}"/>
</apex:pageblock>
</apex:form>
</apex:page>
I am not very much clear with your requirement, but as you said in the previous thread :
"I am using account as a standard controller as i want to diplay list of accounts.
after selecting one account i wanted to display related contacts for that perticular account."
if you want to dispaly the list of account , then you can use
or
you can get the advantage of StandardSetController :