You need to sign in to do that
Don't have an account?
Abdelaziz Hassan
Visualforce Basics - Display Records, Fields, and Tables Module - The page does not include a apex:outputField component bound to the opportunity amount
I'm on the Display Records, Fields, and Tables module under Visualforce Basics, and I'm unable to complete the challenge
Here is the criteria:
Create a page which displays a subset of Opportunity fields using apex:outputField components. Bind the Name, Amount, Close Date and Account Name fields to the apex:outputField components.
Challenge Requirements
The page must be named OppView
It must reference the Opportunity standard controller
It must have four apex:outputField components bound to the following Opportunity fields:
Opportunity Name
Amount
Close Date
Account Name of the Opportunity
Here is my code from the dev console:
<apex:page standardController="Opportunity">
<apex:pageBlock title="Opportunities">
<apex:pageBlockSection>
<apex:outputField value="{!Opportunity.Name}"/>
<apex:outputField value="{!Opportunity.Amount}"/>
<apex:outputField value="{!Opportunity.CloseDate}"/>
<apex:outputField value="{!Opportunity.AccountId}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
Here's the error I receive:
The page does not include a apex:outputField component bound to the opportunity amount
Also here's the error I receive from the dev console, it is having trouble running the outputField line for the Opportunity.Amount:
Currency fields on entities with effective dated currency are not supported.
I'm not sure if it's a configuration or dev issue, but any assistance to clear this challenge would be greatly appreciated!
Here is the criteria:
Create a page which displays a subset of Opportunity fields using apex:outputField components. Bind the Name, Amount, Close Date and Account Name fields to the apex:outputField components.
Challenge Requirements
The page must be named OppView
It must reference the Opportunity standard controller
It must have four apex:outputField components bound to the following Opportunity fields:
Opportunity Name
Amount
Close Date
Account Name of the Opportunity
Here is my code from the dev console:
<apex:page standardController="Opportunity">
<apex:pageBlock title="Opportunities">
<apex:pageBlockSection>
<apex:outputField value="{!Opportunity.Name}"/>
<apex:outputField value="{!Opportunity.Amount}"/>
<apex:outputField value="{!Opportunity.CloseDate}"/>
<apex:outputField value="{!Opportunity.AccountId}"/>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:page>
Here's the error I receive:
The page does not include a apex:outputField component bound to the opportunity amount
Also here's the error I receive from the dev console, it is having trouble running the outputField line for the Opportunity.Amount:
Currency fields on entities with effective dated currency are not supported.
I'm not sure if it's a configuration or dev issue, but any assistance to clear this challenge would be greatly appreciated!
Hi there,
Look at the documentation here - https://help.salesforce.com/articleView?id=administration_enable_advanced_currency_management.htm&type=5
It says the following
When advanced currency management is enabled, Visualforce <apex:inputField> and <apex:outputField> components cannot display currency fields.
This is the reason you're unable to save this page.
You need to disable Advanced Currency Management and then the above code should work fine for you.
Go to Setup > Manage Currencies > click on "Disable" button for Advanced Currency Management.
Hope this helps.
All Answers
Hi there,
Look at the documentation here - https://help.salesforce.com/articleView?id=administration_enable_advanced_currency_management.htm&type=5
It says the following
When advanced currency management is enabled, Visualforce <apex:inputField> and <apex:outputField> components cannot display currency fields.
This is the reason you're unable to save this page.
You need to disable Advanced Currency Management and then the above code should work fine for you.
Go to Setup > Manage Currencies > click on "Disable" button for Advanced Currency Management.
Hope this helps.