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

Filter record type selection


I'm trying to create a visualforce page which filters the standard Opportunity record type selection page based on the related Account record type. I'm getting this error upon saving my VF:

Error: Unknown property 'AccountStandardController.recTypeID'

Here's my code:

<apex:page standardController="Account">
    <apex:form >
            <apex:selectList value="{!recTypeID}" size="1">
                <apex:selectOptions value="{!myOptions}"></apex:selectOptions>
    <apex:commandButton value="Next" Action="{!continue}"/>


public class myController {

        public List<SelectOption> opts             {get;set;}
        private String oType                        {get;set;}
        public Id recTypeId                         {get;set;}

            oType = 'Opportunity';

        public List<SelectOption> myOptions() {
            opts = new List<SelectOption>();

            opts.add(new SelectOption('','--Please Select Record Type --'));

            for(RecordType rts : [Select Id, DeveloperName, Name From RecordType Where SObjectType = 'Opportunity']) {
            opts.add(new SelectOption(,;

                Map<String,List<String>> mapping = new Map<String,List<String>>();
                mapping.put('Small_Medium_Sized_Business', new List<String>{'Defined_Benefit_Retirement','Defined_Contribution_Retirement'});

            return opts;


Great question.  And even simplier solution.  Right now, your VF page has a single controller, namely the standard Account. Your Custom Controller needs to be added into the mix.

Within the Page tag of the VF page, make it look like:
<apex:page standardController="Account" extensions="myController">

Once you do this though, your myController constructor will have to include a single argument - the Standard Controller.  

So, maybe your Apex Controller Constructor look like this:

myController(ApexPages.StandardController stdController){
            oType = 'Opportunity';