+ Start a Discussion
Surender reddy SalukutiSurender reddy Salukuti 

opportunity error

Hi ,
i wrote program using combination of appex and visual force 

public class Example_pr2 {
    public account acc {set;get;}
    public opportunity opty {set;get;}
    public Example_pr2(){
        acc= new account();
        opty =new opportunity();

and visual force program 
<apex:page controller="Example_pr2">
        <apex:pageBlockSection title="Account">
         <apex:inputField value="{!acc.name}"/>
         <apex:inputField value="{!acc.phone}"/>
         <apex:inputField value="{!acc.industry}"/>
          <apex:inputField value="{!acc.rating}"/>
          <apex:inputField value="{!acc.ownership}"/>
        <apex:pageBlockSection title="opportunity">
            <apex:inputField value="{!opty.name}"/>
            <apex:inputField value="{!opty.StageName}"/>
            <apex:inputField value="{!opty.closedate}"/>
            <apex:inputField value="{!opty.Amount}"/>

but i am getting error in opportunity fields 
error message-
Could not resolve the entity from <apex:inputField> value binding '{!opty.name}'.  <apex:inputField> can only be used with SObjects, or objects that are Visualforce field component resolvable.

Meghna Vijay 7Meghna Vijay 7
Hi ,

It works fine in my org. Can you see if you have Read,Create permission on Opportunity Object for your profile?
User-added image
Surender reddy SalukutiSurender reddy Salukuti
Thanks for your replay , i have access but i am not getting output if you find issue please tell me Thanks