+ Start a Discussion
mdsmds 

standard controller extension

hey everyone, m new to apex.i dont knw why but m  getting this error:  Incompatible types since an instance of SObject is never an instance of opportunity. plz help.... 

 

 

 

here is a bit of my code:

public with sharing  class opportunityExtensions { 

public opportunity opp;

   public opportunityExtensions(ApexPages.StandardController controller)     {     

  this.opp=(Opportunity)controller.getRecord(); 

     

}


Rahul SharmaRahul Sharma

Can you post your page

SteveBowerSteveBower

Post your VF code, but, before you do, check that you have:

 

<apex:page standardController="Opportunity" extensions="opportunityExtensions">

 

 

and you don't have RecordSetVar in there.

 

Best, Steve.