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
Ravi Kumar 259Ravi Kumar 259 

We have 3 objects Account, Contact, Opportunity. In a VF page, we need to display the names of contact & Opportunity which are related to Accoun

edoardo_spanoedoardo_spano
Hi,
try to use this code.

PAGE:
<apex:page standardController="Account">
    <apex:pageBlock >
        <apex:pageBlockTable value="{!Account.Contacts}" var="c">
            <apex:column value="{!c.Name}"/>
        </apex:pageBlockTable>
        <apex:pageBlockTable value="{!Account.Opportunities}" var="o">
            <apex:column value="{!o.Name}"/>
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

You must specify the account id in the URL, like this: https://yoursfdcurl/apex/pagename?Id=accountid

Bye
Ravi Kumar 259Ravi Kumar 259
thanks