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
mworldmworld 

Dynamic Picklist values based on Record Type in VF

Is it possible to have picklists on a custom VF page respect the recordtype (with regards to their available choices) without elaborate if/else coding? Stock pages do this automatically with Page layoputs but once you cross over to a custom page it seems you lose this completely.
JimRaeJimRae
Not supported today.  Many people wish it was, including me!
There is an idea on the idea exchange you can and should vote for!


TehNrdTehNrd
http://ideas.salesforce.com/article/show/10092833/Support_Dependent_Picklists_in_Visualforce
jeffdonthemicjeffdonthemic

Here's the thread that explains the bug: Re: Picklist InputField does not respect RecordType?

 

Sam Arjmandi has a custom component that may be a workaround: A Picklist Component For Your Visualforce Pages

 

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

TehNrdTehNrd
Technically it's not a bug, it's just not currently supported.
jeffdonthemicjeffdonthemic

Point taken. I stand (actually sitting at my desk) corrected.

 

Jeff Douglas

Informa Plc

http://blog.jeffdouglas.com

TehNrdTehNrd
But I do see how it could bug you that it's not supported. Lame, I know, but I couldn't resist. :smileyvery-happy:
Saurabh DhobleSaurabh Dhoble

There is no out of the box way to do this - you will have to write some javascript to do this.

Refer to this blog post for details.