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
Doug AckermanDoug Ackerman 

System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Direction: bad value for restricted picklist field: backwards: [Direction__c]

I am getting this error, but cannot figure out how to correct it.  System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Direction: bad value for restricted picklist field: backwards: [Direction__c]
Nithesh NNithesh N

Hi Doug,

It Looks like you are trying to insert a record with Picklist value which is not defined in the picklist value set.

When a picklist field is created in the object, we have an option to "Restrict" the picklist values defined at that time. 

Which is the case in this situation. And It seems you are trying to insert  a picklist value which is not defined in that picklist value set.

 

Doug AckermanDoug Ackerman
Hi Nithesh, Thank you for responding. How do I edit that? I cannot see where that can be done. Thanks, Doug
Nithesh NNithesh N
You can do by going to object>Fields>Picklist field> Picklist Options >Restrict picklist to the values defined in the value set.> Uncheck this

You can find a detaled solution at this link too (https://success.salesforce.com/answers?id=9063A0000019SxSQAU). 


 
junaid soomrojunaid soomro
@nitesh N 
Choosen best answer 
maheswar kondalamaheswar kondala
If you enable "Restrict picklist to the values defined in the value set" while creating picklist, Then it shows an error like that. Ensure to Disable it. OBJECT MANAGER>>OBJECT(where created a picklist)>>FIELDS & RELATIONSHIPS>> FIELD LABEL(which you created picklist)>>EDIT>>PICKLIST OPTIONS>>Make sure to Disable Restrict picklist to the values defined in the value set.User-added image
Debaranjan GhoshDebaranjan Ghosh
Hello Thanks for the solution . It works ! But I would to post a different problem I have 3 Values in the List 1. ABC , 2 . CEF , and 3 . DEF when I give  a value of any one of them it throws this error  though the value is within the list with same case. and when I remove the Required check and make it uncheck it stops . Any idea why it treats the given value not within the list even when it is pretty much present within the list