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
venkat davuluri 31venkat davuluri 31 

Visualforce page to display a list of related custom object / Error: Unkonow Property.

Hello All,

I am trying to design a console where the first block of it contains a custom object "Store" something similar to Account. I want a list of Associates(custom object similar to contacts) in the same section of the block. 

Could anyone give me the idea for a vf page of the list of associates on the store object:


I have the following code and the error:
<apex:page standardController="Store__C">
<apex:pageBlock title="Hello {!$User.FirstName} {!$User.LastName}!">
We are viewing the Associates for this <b>{!Store.name}</b> Store.
</apex:pageBlock>
<apex:pageBlock title="Associates">
<apex:pageBlockTable value="{!Store_c.Associates}" var="Ass.">
<apex:column value="{!con.Name}"/>
<apex:column value="{!con.Lastname}"/>
<apex:column value="{!con.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

and getting the error : Error: Unknown property 'Store__cStandardController.Store

Thank you
Venkat
RT2311RT2311
This is how your code should be, 

<apex:page standardController="Store__C">
<apex:pageBlock title="Hello {!$User.FirstName} {!$User.LastName}!">
We are viewing the Associates for this <b>{!Store__C.name}</b> Store.
</apex:pageBlock>
<apex:pageBlock title="Associates">
<apex:pageBlockTable value="{!Store__C}" var="Ass">
<apex:column value="{!Ass.Name}"/>
<apex:column value="{!Ass.Lastname}"/>
<apex:column value="{!Ass.Phone}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

value  ----- The collection of data displayed in the page block table.
var --------- The name of the variable that represents one element in the collection of data specified by the value attribute. You can then use this variable to display the element itself in the body of the pageBlockTable component tag.
 
venkat davuluri 31venkat davuluri 31
Hello RT2311,

I tried the code which you have posted and i am stuck with this error:
Error: Invalid field Lastname for SObject Store__c