In apex code, I want to list the legal values ββfor the select box. To do this, I can simply call Account.Foobar__c.getDescribe().getPickListValues() , and I have a list of Schema.PickListEntry values.
However, it is possible to set several types of records for this sObject. For example, an account may have the types of entries Producer, Distributor, and Retail. In the Salesforce setting, you can edit (limit) the records of the selection list for each field, depending on the type of record. Thus, Retailer accounts can only use a subset of the selection list values ββfor the Foobar field.
So basically I want Account.Foobar__c.getDescribe().getPickListValues('Retailer') , but that is not the syntax. The validFor method looks promising, but it looks like it is only for field-dependent picklists β a selector filtered only by record type returns false for isDependentPicklist .
David
source share