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
ShaTShaT 

Bad value for restricted picklist field: Read/Write INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST

HI All ,

 

I am facing a issue reagrding the field update from apex.

 

System.DmlException: Update failed. First exception on row 0 with id 800c00000001DvXAAU; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Status: bad value for restricted picklist field: Active: [Status]

 

I have provide all the permissions for the field. but still facing the above issue.

 

Please help!!!..

 

Thanks

Shailu

 

Best Answer chosen by Admin (Salesforce Developers) 
ShaTShaT
Hi All ,

I have resolved the issue. The error was occurring because the pick-list value i was inserting from code was not there. so it was giving me above error.

All Answers

ShaTShaT
Hi All ,

I have resolved the issue. The error was occurring because the pick-list value i was inserting from code was not there. so it was giving me above error.
This was selected as the best answer
Laurent VLaurent V
or uncheck the option "Strictly enforce picklist values"
Debendra Ray 8Debendra Ray 8
Hi,
I'm facing this issue despite the fact that , I have uncheck the option "Strictly enforce picklist values" on the dependent field. Following is the  code which throws this error in PRODUCTION Org , however the passes the testing in SANDBOX :
@istest(SeeAllData=true)  private class TestEmailAlertsForQoute {             static testmethod void test() {                            Test.startTest();             Account acc = new Account(name='acc1');           insert acc;                   Opportunity oppr = new Opportunity();           oppr.AccountId = acc.ID;           oppr.Annual_Contract_Value_ACV__c = 111;           oppr.BU__c = 'MJ';           oppr.CloseDate = Date.today();           oppr.Contract_Opportunity_Estimate_CoE__c = 111;           oppr.Total_Contract_Value_TCV__c = 111;            oppr.Name = 'SubmitforQuoteApproval';            oppr.StageName = 'Prospecting';             oppr.Date_on_Opportunity_Prospecting_Stage__c = Date.today();           insert oppr;                      oppr.Region__c ='North';           oppr.Responsible_Sales_Rep__c ='Siddharth Bhatia';           update oppr;                                         Quote quot1 = new Quote ();           quot1.Name = 'TestPropForSandbox2016-10';            quot1.Status ='Draft';           quot1.OpportunityId = oppr.id ;           insert quot1;                                  quot1.Status = 'Acceptance by Client';            update quot1 ;                       Test.stopTest();          }           }

Any help resolving the error : System.DmlException: Update failed. First exception on row 0 with id 0066F00000jPi87QAC; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: Siddharth Bhatia: [Responsible_Sales_Rep__c]
Stack Trace: Class.TestEmailAlertsForQoute.test: line 24, column 1

Regards,

Debendra
Andy Kallio 7Andy Kallio 7
Hi Debendra. I'm having the same issue in a flow. Please update if you find a solution. My flow worked fine in dev sandbox, but is now failing because of this error in a staging sandbox. 
Andy Kallio 7Andy Kallio 7
I actually just found the answer that helped me. See the answer towards the bottom from Neil: https://developer.salesforce.com/forums/?id=906F0000000kGGWIA2

Basically, had to make sure the record types were assigned to the picklist values. 
shivam sharma 44shivam sharma 44
Hi,

I resolved the error while uncheckng the option "Restrict picklist to the values defined in the value set" for picklist.
give a try it may solve the issue
Christopher Littlefield 6Christopher Littlefield 6
Unchecking the the "Restrick picklist to values..." option worked for me too.