Skip to main content

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()}"/>

</apex:page>

I'm completely at a loss about why the Visualforce page won't access the ProductRate method! Please help!
2 respuestas
  1. 3 may 2023, 15:20

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

    Please use the above code
0/9000