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
Ryno LourensRyno Lourens 

Building a Controller Extension

I'm trying to build a controller extension for the Opportunity Standard Controller, along with a Visualforce page that  pullsa method from that extension. However, when I try to save the Visualforce page I receive the error: "Unknown function ProductRate. Check spelling."

Here is the Controller Extension:

public class TestClass {
    private final Opportunity opp;

    public TestClass(ApexPages.StandardController stdController) {
        this.opp = (Opportunity)stdController.getRecord();
    public String getProductRate() {
        return 'rate';

And here is the Visualforce page:

<apex:page standardController="Opportunity" extensions="TestClass">
     <apex:outputText value="{!ProductRate()}"/>

I'm completely at a loss about why the Visualforce page won't access the ProductRate method! Please help!
prakash SFprakash SF
<apex:page standardController="Opportunity" extensions="TestClass"> <apex:outputText value="{!ProductRate}"/> </apex:page>

Please use the above code
Ryno LourensRyno Lourens

I tried this update, and now I am receiving the following error:

Unknown property 'OpportunityStandardController.ProductRate'

Mitchel smithMitchel smith
Would you like to guide me about?