You need to sign in to do that
Don't have an account?

Invalid type: Schema.oppotunity
Hi..... All
I am trying to fetch the data from Opportunity and display in vf page,But i am facing this Error any one can help me.
[(apex Error) Invalid type: Schema.oppotunity (VF page Error) Unknown property 'SOQL_Ex2.lopty']
VF Code:
<apex:page controller ="SOQL_Ex2">
<apex:form>
<apex:pageBlock title ="SPQL_Ex2">
<apex:pageBlockTable value="{!lopty}" var="op">
<apex:column value="{!op.name}"/>
<apex:column value="{!op.stagename}"/>
<apex:column value="{!op.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Class:
public class SOQL_Ex2
{
public list<Opportunity> lopty {get;set;}
public SOQL_Ex2()
{
lopty=[select Name,StageName,CloseDate from oppotunity];
}
}
I am trying to fetch the data from Opportunity and display in vf page,But i am facing this Error any one can help me.
[(apex Error) Invalid type: Schema.oppotunity (VF page Error) Unknown property 'SOQL_Ex2.lopty']
VF Code:
<apex:page controller ="SOQL_Ex2">
<apex:form>
<apex:pageBlock title ="SPQL_Ex2">
<apex:pageBlockTable value="{!lopty}" var="op">
<apex:column value="{!op.name}"/>
<apex:column value="{!op.stagename}"/>
<apex:column value="{!op.closedate}"/>
</apex:pageBlockTable>
</apex:pageBlock>
</apex:form>
</apex:page>
Apex Class:
public class SOQL_Ex2
{
public list<Opportunity> lopty {get;set;}
public SOQL_Ex2()
{
lopty=[select Name,StageName,CloseDate from oppotunity];
}
}

Replace "oppotunity" with "Opportunity" at last line in apex .You have written wrong spelling of opportunity