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
raoyijunraoyijun 

Constructor not defined: [selectOption].<Constructor>(String, String)

The following code in other people's development environment is right,but   in my development environment is wrong.Why?

 

  public List<SelectOption> getItems() {
          List<SelectOption> options = new List<SelectOption>();
          options.add(new SelectOption('US','US'));
          options.add(new SelectOption('CANADA','Canada'));
          options.add(new SelectOption('MEXICO','Mexico'));
          return options;
   }

 error:Constructor not defined: [selectOption].<Constructor>(String, String)

 

  

in addition:

  PageReference acctPage = new ApexPages.StandardController(account).view();

error:Illegal assignment from System.PageReference to pageReference

 

what is the difference between  System.PageReference  and pageReference?

 

NaishadhNaishadh

check your class version

raoyijunraoyijun

my  API  version is 20.0 

hamshuhamshu

HI Raoyijun,

 

Check If any Class Which has the name select option and deactive or delete it..

 

 

Thanks,

jaba