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
Devi Sree 6Devi Sree 6 

Data not being displayed for visual force pages

My code does not have any problems.But  data is not being displayed in the preview window except the lables.Challenge has been passed.



<apex:page standardController="Opportunity">
   <apex:pageBlock title="Opportunity  Details">
    <apex:pageBlockSection>
        <apex:outputField value="{!Opportunity .Name }"/>
        <apex:outputField value="{! Opportunity.Amount }"/>
        <apex:outputField value="{! Opportunity.CloseDate }"/>
        <apex:outputField value="{! Opportunity.Account.Name }"/>
    </apex:pageBlockSection>
       </apex:pageBlock>
  
</apex:page>
Prakash NawalePrakash Nawale
Hi Devi,

You need to pass Opportunity Id in url lik
https://playful-bear-399724-dev-ed--c.na73.visual.force.com/apex/pagename?Id=0061I000003OixC

 
Akshay_DhimanAkshay_Dhiman
Hi Devi,
According to your question, there are lots of Opportunity in your org then how it will display the opportunity details.
There are two options to show Opportunity details:
  • You have to use apex repeat.
  • If you pass any Opportunity Id in URL then your code will work.
Let us suppose your page name is samplepageQuestion then you have to use like this-
https://dismal-dev-ed--c.ap5.visual.force.com/apex/samplepageQuestion?id=0067F000002AITX

Screenshot:
User-added image

I hope it will help you!!
If this answers your query please mark this question as a solved so that it can be filtered out from unsolved questions.

Regards,
Akshay