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
Golden10Golden10 

Error: Invalid field opportunity for SObject Opportunity

I am trying to build a button to overide the EDIT button on an opportunity, but i keep getting the error -
 

Error: Invalid field opportunity for SObject Opportunity

Below is the first 13 lines of code ive developed and it keeps pointing to the first line. Anyone know what i am doing wrong? Could it be about having record type's in place?

 

<apex:page standardController="Opportunity" sidebar="false">
    <apex:sectionHeader title="Edit Opportunity" subtitle="{!opportunity.name}"/>
    <apex:form >
        <apex:pageBlock title="Edit Opportunity" id="thePageBlock" mode="edit">
            <apex:pageMessages />
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Cancel" action="{!cancel}"/>               
            </apex:pageBlockButtons>
            <apex:actionRegion >
                <apex:pageBlockSection title="Basic Information" columns="1">
                    <apex:inputField value="{!opportunity.name}"/>
                    <apex:inputField value="{!opportunity.ForecastCategoryName}"/>
 

Any help would be appreciated! Cheers guys
Ron HessRon Hess
it's just a guess, but do you have opportunity.opportunity somewhere in your page

if you start with a simple page that uses these lines does it work?
you may have to start simple and add in lines a bit at a time until you find the line that is causing the message.

the error does not know what line is causing the issue, so it points to the first line.
Golden10Golden10
Awesome, all done. i had a 'opportunity.' in a place it wasnt welcomed ;)
 
Thanks again!