function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gautam_KasukhelaGautam_Kasukhela 

Bad value for restricted picklist field, eben though the picklist has the value

Hello,
       I have a custom field on the Account object (no record types) which uses a global picklist. We have built a REST web service and are passing a value for this picklist. Even though we are passing the same value in the web service, we are facing the issue "INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Primary Marketplace: bad value for restricted picklist field: Myntra: [Primary_Marketplace__c]"

Screen shot of the global picklist:-
User-added image

And the Primary Market place  custom field's screen shot which uses this global picklist

User-added image

Any inputs as to what might be wrong here??

Regards,
Gautam.

 
Best Answer chosen by Gautam_Kasukhela
Gautam_KasukhelaGautam_Kasukhela
Hello Ishwar,
          I got the issue. Apologies, was a mistake from my end. The contact object also had a field whose API name was the same, hence the confusion. The custom field in the Contact Object did not have the required values in the gobal picklist.

All Answers

Ishwar ShindeIshwar Shinde
Hi Gautam,

Could you please double check the value you are getting in debug log?

Some thing wrong with the value only either wrong or incorrect.. You can remove the restricted clause and try to create record, then check the picklist value.

 
Gautam_KasukhelaGautam_Kasukhela
Hello Ishwar,
             I did check the value but was of no help as the value in the logs was exactly the same as in the picklist field.

Also, I don't think we can remove the restricted clause from the setup. Is there a way to do it??
Gautam_KasukhelaGautam_Kasukhela
Hello Ishwar,
          I got the issue. Apologies, was a mistake from my end. The contact object also had a field whose API name was the same, hence the confusion. The custom field in the Contact Object did not have the required values in the gobal picklist.
This was selected as the best answer