Loading

Picklist fields are not case sensitive and cannot contain duplicate inactive types

Date de publication: Oct 13, 2022
Description
Occasionally, the need arises to utilize multiple "inactive" entries for a picklist where some values differ by case, such as inserting "TEST" in one record and "Test" in another in an attempt to differentiate them. "Inactive" values are defined in Field Types documentation

As per this document: When inserting an unrestricted picklist field that does not have a PicklistEntry, the system creates an “inactive” picklist value. This value can be promoted to an “active” picklist value by adding the picklist value in the Salesforce user interface.

So if you have a need to contain "TEST", "Test" and "test" in your picklist entries, you will first insert one -- say, "Test". All subsequent entries of "TEST" and "test" will then become "Test" since the comparisons are done at the object level; hence, you can never have case sensitive picklist values. When attempting to insert these picklist values of different cases (that are supposed to be different values altogether), they are deemed identical, and the second entry will take the value of the first entry. This is because picklist values are not unique to a particular record; rather, they are tied to the entire object. 
Résolution
If you seek to have record-by-record uniqueness present in fields, then you'd need to create a read-only text field that is updated by triggers only. That way, you can place the value where you'd like (e.g., prefix, suffix, etc.) with a trigger update. You can either hard-code these values, or have something like a custom setting available to act as a store for the various cases of the text that needs to be inserted. This will allow record-by-record uniqueness, since picklist values do not permit more than one entry with the same string (i.e., insensitive comparisons). 
Numéro d’article de la base de connaissances

000386557

 
Chargement
Salesforce Help | Article