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
sfdcdeveloperssfdcdevelopers 

unable 2 see the fields

<apex:page standardController="Account">
  <apex:pageBlock title="Hello{!$User.FirstName} {!$User.LastName}">
  </apex:pageBlock>
   <apex:PageBlock title="Contacts">
       <apex:pageBlockTable value="{!account.Contacts}" var="con">
       <apex:column value="{!con.name}"/>
       <apex:column value="{!con.LastName}"/>
       <apex:column value="{!con.Phone}"/>
       <apex:column value="{!con.Title}"/>
       </apex:pageBlockTable>
   </apex:PageBlock>
</apex:page>

 

want 2 create a table but i am unable 2 see the fields name,LastName,phone,Title and their data pls help me what is the error

Avidev9Avidev9
First of all you have to pass a Valid account Id to the Page.

Say If your page name is "AccountPage" the you should pass a Id like "/apex/AccountPage?id=validaAccountId"
Abhi_TripathiAbhi_Tripathi

Hi,

 

What are you passing the parameter in your vf page

 

edit and paste this in your URL, then automatically all the name of the fields will be fetched.

 

https://c.ap1.visual.force.com/apex/YOUR-PAGE-NAME?Id=(put Account Id here)

PremanathPremanath

In URL You have to Provide the Account Record ID

 

Something Like

 

https://c.ap1.visual.force.com/apex/vfpagename?id=0019000000DKKwQ

 

Try like this way

 

 

 

prem

Kamatchi Devi SargunanathanKamatchi Devi Sargunanathan

Hi,

 

I could guess what the problem is. Your contact doesn't gets displayed because, you had tested running the page using apex/Pagename directly isn't it?

 

If you do that so, you can only view the global values of username alone. But contact is related to accounts. Thats why you can't direcly access those contacts without querying in custom controller for pageblocktable display.

 

To see the contacts details also means, all you need to do is to set up inline VF page.

 

To do that follow the steps given below,

  • Go to the Account page layout.
  • Click on Vf pages.
  • Select your page name and drag & drop it to the layout section.
  • Give the settings for Inline VF page.
  • Click Save.

Now go and check any of the records, so that you will see the contacts details as well.

 

Hope so this helps you...!

Please mark this answer a Solution and please give kudos by clicking on the star icon, if you found this answer as helpful.