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>());
controllingValues.add(label);
}
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.