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
flewellsflewells 

Picklist field filtered by record type on Visualforce page not respecting record type settings

I have a Visualforce page (developed per-Winter '11 by someone else, I'm not a developer) that shows a multi-select picklist field.  This field is showing all its possible picklist values, even though I have specified the values applicable to each record type.

 

I know in Winter '11 that Salesforce.com added Visualforce support for Record Types.  Reading through the Developers Guide (If the <apex:inputField> tag refers to a picklist field that's filtered by a record type the rendered <apex:inputField> component only displays options compatible with that record type.), I'm led to believe that my Visualforce page should just pick up the record type settings for my multi-select picklist field.  But that's not the case.  Wishful thinking?

 

Any guidance for what needs to be in place for the record type settings to be picked up?

Best Answer chosen by Admin (Salesforce Developers) 
colemabcolemab

It sounds like you are trying to use a feature that was developed on a later version of the API than the page was created with.

 

To do this, you will need to change the API version on the page and/or controller class.  This is easily accomplished in the Eclipse development IDE.

 

In the web GUI you can do it under: Setup->App Setup->Develop->Pages->Edit->Version Settings tab.

 

Please be advised that changing API versions may require some additional code changes to maintain functionality.

All Answers

colemabcolemab

It sounds like you are trying to use a feature that was developed on a later version of the API than the page was created with.

 

To do this, you will need to change the API version on the page and/or controller class.  This is easily accomplished in the Eclipse development IDE.

 

In the web GUI you can do it under: Setup->App Setup->Develop->Pages->Edit->Version Settings tab.

 

Please be advised that changing API versions may require some additional code changes to maintain functionality.

This was selected as the best answer
flewellsflewells

Thanks @colemab, I just updated the API version for my page and it's now respecting Record Type settings.  Now for my testing...

colemabcolemab

great news.  Reply back here if you hit any bumps in your testing ...

bharathvbharathv
Hi

can anyone help me with sample code like how achieve this functonality in vf page

for example: if I select record type 1, it should display particular picklist values that I slected already, and same for other picklist values

Regards,
Bharath
Saurabh DhobleSaurabh Dhoble

There is a work around you can use to display record types based on the user's profile. As for switching picklist values based on record type, that is going to be difficult.

Check out this post for a workaround.