Am designing a JQuery AutoComplete search box in visualforce page and getting the data source from controller class from two picklist fields(Controlling and dependent). The autocomplete search box works fine but it loads all the values from the picklist fields. I want to load the picklist values based on record type. Here

List<Schema.PicklistEntry> contrEntries = ctrlField.getDescribe().getPicklistValues();
for (Schema.PicklistEntry ple : contrEntries) {
    String label = ple.getLabel();
    objResults.put(label, new List<String>());

Can we add the picklist values based on particular record type?.

I found that this can be done using MetaData API, but I don't want to deploy all the MetaData files into our client org.

Can be done using describeLayout?. If yes, please help me to understand.

2 Answers 2


sorry i tried over same issue but didnt get any solution but you can get idea by success comunity by rest call



This is For those who are looking to get picklist values in LWC you can use UI-API adapter "getPicklistValuesByRecordType()" to get picklist values specific to the record type. More details at https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.reference_wire_adapters_picklist_values_record

  • OP wants to work in Visualforce, not LWC. Apr 19, 2021 at 23:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .