INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST" salesforce
Fixes Salesforce INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST: the value is not in the picklist's allowed values for that record type. List the valid values via describe and map to them. Use when writes fail with this error. Not for text-field length errors.
TL;DR
The picklist is restricted, so only its defined values are accepted, and your value is not among them (or is null where null is not allowed). Pull the valid values with describe, including record-type scoping, and map your source values to them before writing.
Error
[ {
"message" : "bad value for restricted picklist field: Enterprise",
"errorCode" : "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST",
"fields" : [ "Type" ]
} ]Steps
- Describe the field and read its picklistValues, noting which are active. Expected: the exact allowed list.
- Check record-type scoping: a value valid for one record type can be invalid for another. Expected: you confirm the value against the record's actual record type.
- Build a mapping table from your source values to the allowed values (for example, source "Enterprise" maps to picklist "Enterprise Corp"). Expected: every source value has a target.
- For values with no sensible target, decide: add the value to the picklist (admin) or map to a default like "Other". Expected: an explicit policy, not silent drops.
- Apply the mapping in the pipeline before the API call. Expected: zero picklist rejections.
When to use
- Writes fail with INVALIDORNULLFORRESTRICTED_PICKLIST.
- A migration or enrichment load fails on picklist fields.
- The same value works for one record type but fails for another.
When not to use
- Unrestricted picklists (those accept anything; the error would be different).
- STRINGTOOLONG (length, not membership).
Tool compatibility
- Salesforce REST, SOAP, and Bulk APIs; describe calls for picklist metadata.
- Data Loader and agent mapping layers.
Variant phrasings
bad value for restricted picklist field
The long form; the message quotes the rejected value.
null for restricted picklist
Null is not an allowed value here; supply a real value or make the field optional.
Why it happens
Restricted picklists enforce a closed vocabulary at the database level. Source systems with free-text fields (industry, type, source) constantly invent values outside that vocabulary.
Edge cases
- Inactive picklist values reject on write even though they display on old records; reactivate or remap.
- The API uses the API name of the value, which can differ from the label in multilingual orgs.
- Default values do not apply when you explicitly pass null; omit the field instead.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstx1WawkVMM0WpYcw2No7RQ