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
bohemianguy100bohemianguy100 

picklist values by record type

I've been reading several articles on trying to get the picklist values by record type, but I have stumbled on quite what I'm looking for.

 

I'm using the following code in apex to get all record type values:

 

    public List<SelectOption> getShippingMethods() {
        List<SelectOption> options = new List<SelectOption>();
        Schema.DescribeFieldResult fieldResult = Order_Fulfillment__c.Shipping_Method__c.getDescribe();
        List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
        options.add(new SelectOption('', 'Select'));
        for( Schema.PicklistEntry f : ple) {
            options.add(new SelectOption(f.getValue(), f.getLabel()));
        }
        return options;
    }

  Is there a way to filter the piclist values for a specfic record type? 

 

Thanks.

Saravanan @CreationSaravanan @Creation

Hi,

 

This is not possible.