You need to sign in to do that
Don't have an account?
Devi 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>
<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>
You need to pass Opportunity Id in url lik
https://playful-bear-399724-dev-ed--c.na73.visual.force.com/apex/pagename?Id=0061I000003OixC
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:
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