INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST: <value>: bad value for restricted picklist field
You wrote a value to a Restricted Picklist that isn't in the picklist's value list. Restricted means exactly that — only configured values are accepted, no free-form. The fix is to add the value to the picklist or clean the input.
Also seen asINVALID_OR_NULL_FOR_RESTRICTED_PICKLIST·bad value for restricted picklist·Invalid picklist value·restricted picklist value not in list
A regular Picklist accepts any string at the API level (the platform shows a warning in the UI but allows the save). A Restricted Picklist rejects any value not in the configured list, both UI and API.
How to find the configured values
Setup → Object → Picklist Field → Values section. The list there is the only set of valid values.
If the value you want to write isn't on the list:
- Add it to the picklist if it's a legitimate new value
- Map it to an existing value if it's a synonym
- Reject the input if it's a typo or invalid
The Apex pattern
public static String normalizeStatus(String input) {
Set<String> valid = new Set<String>{'New', 'Working', 'Closed - Won', 'Closed - Lost'};
if (!valid.contains(input)) {
throw new IllegalArgumentException('Status "' + input + '" is not allowed');
}
return input;
}
For dynamic validation against the actual picklist:
public static Set<String> getPicklistValues(SObjectField field) {
Set<String> values = new Set<String>();
for (Schema.PicklistEntry entry : field.getDescribe().getPicklistValues()) {
if (entry.isActive()) values.add(entry.getValue());
}
return values;
}
Set<String> validStatuses = getPicklistValues(Account.Status__c);
This adapts to the picklist as it's edited — no hard-coded list to maintain.
Restricted vs Standard
- Standard picklist (no Restricted checkbox) — accepts any string, displays a warning in UI for unknown values
- Restricted picklist (Restricted checkbox on) — rejects unknown values, both UI and API
- Multi-select picklist with restrictions — complex; only listed values allowed in the semicolon-separated stored string
A subtle case: case sensitivity
Picklist values are typically case-insensitive on the UI but case-sensitive at the API level. Closed - Won and closed - won are different values from the platform's perspective. Always preserve the exact case.
When the value IS on the list
Two suspects:
- Inactive picklist value — a value can be marked Inactive while keeping its definition. Inactive values are not assignable but show in old records. Either reactivate or pick an active value.
- Record-Type-restricted value — a picklist value can be enabled per record type. If the record's RecordTypeId allows only some values, others are rejected. Setup → Record Types → Picklist Values shows which are enabled per record type.
A migration tip
If you're tightening a picklist by checking the Restricted box on a previously-loose field, the platform will refuse to save records with values not on the list — even existing records. Audit and clean before flipping the toggle.
