+ Start a Discussion
Heather BazelHeather Bazel 

Error: Unknown property for standardController

Hi all,
I am learning Visualforce and I am trying to add some VF code to a Custom Object, but I keep getting this error when I try to save:

Error: Unknown property 'Revenue_Recognition__cStandardController.revenue_recognition'

Controller:
public class revRecExtension
{
    ApexPages.StandardController stdCtrl;
    public revRecExtension(ApexPages.StandardController std)
    {
       stdCtrl=std;
    }
 
    public PageReference save()
    {
        stdCtrl.save();
        return null;
    }
}

VF Code:
<apex:page standardController="Revenue_Recognition__c" extensions="revRecExtension">
<apex:sectionHeader title="Revenue Recognition"/>
<apex:form >
    <apex:pageBlock title="Edit" mode="edit">
        <apex:pageBlockButtons >
            <apex:commandButton value="Save" action="{!save}"/>
            <apex:commandButton value="Cancel" action="{!cancel}"/>
        </apex:pageBlockButtons>
        <apex:pageBlockSection title="Revenue Recognition Details" columns="2">
            <apex:inputField value="{!revenue_recognition.duration__c}"/>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:form>
</apex:page>

Any help would be highly appreciated!!

Thanks!!
Heather
Best Answer chosen by Heather Bazel
sfdcdevsfdcdev
Change input field to:
 
<apex:inputField value="{!Revenue_Recognition__c.duration__c}"/>

 

All Answers

sfdcdevsfdcdev
Change input field to:
 
<apex:inputField value="{!Revenue_Recognition__c.duration__c}"/>

 
This was selected as the best answer
Heather BazelHeather Bazel
YES that worked, THANK YOU!!!