You need to sign in to do that
Don't have an account?
gopal m 14
please help me
1. We have 3 objects Account, Contact, Opportunity.
In a VF page, we need to display the names of contact & Opportunity which are related to Account.
In a VF page, we need to display the names of contact & Opportunity which are related to Account.
<apex:page standardController = ''Account''>
<apex:pageBlock>
<apex:pageBlockTable value ="{!Account.Contacts}" var=con title="Contact name">
<apex:column value ="{!con.Name}"/>
<apex:pageBlockTable value ="{!Account.Opportunity}" var=opp title="Contact name">
<apex:column value ="{!opp.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
All Answers
In the account detail page you can see contact and opportunity details in those respective related lists.
If you want some thing linke list of account and on click/on hover of account you need to show contact and opportunity details you need to go with VF page.
Please refer to visual force developer guide.
Will the user be selecting an Account record, based on which you want to display the related Contacts and Opportunities?
On a standard Account detail page, you already has this information available in the related lists.
So what's the purpose of having this page and showing the same data?
Check the below sample code which demonstrates for both relatedlist example and Pageblocktable example.
Trailhead module - https://developer.salesforce.com/trailhead/module/visualforce_fundamentals
<apex:page standardController = ''Account''>
<apex:pageBlock>
<apex:pageBlockTable value ="{!Account.Contacts}" var=con title="Contact name">
<apex:column value ="{!con.Name}"/>
<apex:pageBlockTable value ="{!Account.Opportunity}" var=opp title="Contact name">
<apex:column value ="{!opp.Name}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>