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
Fiona BurnistonFiona Burniston 

Visualforce workbook help

Hi guys,

​I'm new to using visualforce as a way to customize Salesforce so I’ve started to use the visualforce workbook to help learn the limits, however, I seem to be getting stuck in tutorial #5 (using standard user interface components).
 
Below is what I’ve written (copied from pg18 in the workbook) but I get the error message - Unknown property 'account.contacts' referenced in Tutorial5
 
<apex:page>
<apex:pageBlock title="My Accounts Contacts">
<apex:pageBlockTable value="{!account.contacts}"var="item">
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>
 
Has anyone else received the above error message or know why the above it incorrect?
 
Any help is greatly appreciated.
 
Kind regards,
Fiona 
Best Answer chosen by Fiona Burniston
Vishnu VaishnavVishnu Vaishnav
Hi,

Here is modified code:
<apex:page standardcontroller="Account">
    <apex:pageBlock title="My Accounts Contacts" >
        <apex:pageBlockTable value="{!account.Contacts}" var="item">
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

:::======================================================================:::
Qusetion Solved ? then mark as best answer to make helpful to others .....

All Answers

Vishnu VaishnavVishnu Vaishnav
Hi,

Here is modified code:
<apex:page standardcontroller="Account">
    <apex:pageBlock title="My Accounts Contacts" >
        <apex:pageBlockTable value="{!account.Contacts}" var="item">
        </apex:pageBlockTable>
    </apex:pageBlock>
</apex:page>

:::======================================================================:::
Qusetion Solved ? then mark as best answer to make helpful to others .....
This was selected as the best answer
Fiona BurnistonFiona Burniston
Thank you Vishnu the new code works :)

​Fiona