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
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.