You need to sign in to do that
Don't have an account?
Active Picklist value is not working-Erroring with Bad value
Hi Friends,
I have a strange problem in our org that one of the active picklist value is not working.
There is a field called Nationality__c in contact, and updates are being receved from integration api.
for example : If I get contact updates in which Nationality is "Turkey", contact gets updated correctly without any error.
But with the same contact update api, whenever I get updates for "Libya", I get "bad value for Restricted picklist field" with status code=INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST.
When I check the picklist values of this field, both of these values are Active, not getting any idea why its failing for Libya but not for Turkey.
FYI, this picklist values are created from Global value set.
I have a strange problem in our org that one of the active picklist value is not working.
There is a field called Nationality__c in contact, and updates are being receved from integration api.
for example : If I get contact updates in which Nationality is "Turkey", contact gets updated correctly without any error.
But with the same contact update api, whenever I get updates for "Libya", I get "bad value for Restricted picklist field" with status code=INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST.
When I check the picklist values of this field, both of these values are Active, not getting any idea why its failing for Libya but not for Turkey.
FYI, this picklist values are created from Global value set.
Do you have record types on the object?
If yes, please check if 'Libya' picklist value is available for the record type for which you are updating records.
You can check available picklist values for record type as follow: Go to Object ---> Record Types ---> Select record type ---> There will be related list 'Picklists Available for Editing' on record type detail page ---> Click on 'Edit' for 'Nationality__c' ---> Check 'Selected Values' if 'Libya' is there
---> if not then move 'Libya' from available values to selected values and save.
Hope this will help you
Thanks
Alternative I updated the API name of this value in Global value set to same as value which is being used in this field and it worked.
Any thoughts how updating the api name to same as value fixed it ?
Picklist label is displayed on UI while Picklist API name is used internally to save data or on metadata level. So when you try to save or update a picklist value it is matched to API name instead of the label.