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
riffindusriffindus 

Newbie in visualforce need help on help on identifying objects and fields in visual force.

I am trying to put  all the positions in the position object in a datatable using the visualforce. I am not sure how i can identify the field needed

 

<apex:page standardController="position__c">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are viewing the {!position__c.name} account.
</apex:pageBlock>
<apex:pageBlock title="table">
<apex:pageBlockTable value="{!position__c.???}" var="contact">
<apex:column value="{!Position__c.Name}"/>
<apex:column value="{!Position__c.location}"/>
 </apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

I don't know what to mention in the ??? area and how i can point out the fields of the each position in a tabular form.

Rahul BorgaonkarRahul Borgaonkar

Try this,

 

<apex:page standardController="position__c">
<apex:pageBlock title="Hello {!$User.FirstName}!">
You are viewing the {!position__c.name} account.
</apex:pageBlock>
<apex:pageBlock title="table">
<apex:pageBlockTable value="{!position__c}" var="contact">
<apex:column value="{!contact.Name}"/>
<apex:column value="{!contact.location}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:page>

 

you need to send id of position record along with page link to test it properly

example - https://c.ap1.visual.force.com/apex/positionpage?id=a0090000006XHjU

 

also read "visualforce workbook" pdf on link http://wiki.developerforce.com/page/Force.com_workbook

 

this should help.

riffindusriffindus

Hi Rahul,

 

I think i didn't write what exactly i am looking for in the datatable. my datatable in visualforce page should display all the records in a tabular fashion. If i mention the ID in the URL, it will display only the context related to the particular ID alone but i am looking for all the records to be displayed.

 

 

Rahul BorgaonkarRahul Borgaonkar

Then you have to use recordsetvar attribute of page component. Please follow link for similar example.

 

http://www.salesforce.com/docs/developer/cookbook/index_Left.htm#CSHID=vf_multi_record_edit.htm|StartTopic=Content%2Fvf_multi_record_edit.htm|SkinName=webhelp

 

also go through the pdf link in the my past reply for better understanding of visualforce pages.

riffindusriffindus

Rahul,

 

You got me now. I know to use recordsetvar in the tag but i don't know what would be the value of it. Suppose my custom object API name is Position__c. really i don't know what i should give in recordsetvar value, as i saw that in some example in visual force tutorial. they used "Account "standard object and recordsetvar was set as "Accounts". do i have to provide the plural name over there?

Rahul BorgaonkarRahul Borgaonkar
I think its a variable name and any significant name should work. check this example