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
Mrityunjay Patel 18Mrityunjay Patel 18 

Create new order then i am getting this type error

null: Status: bad value for restricted picklist field: Draft
how to fix the error.it is restricted but how to make unrestricted can anyone solve my problem.
Suraj Tripathi 47Suraj Tripathi 47

Hi Mrityunjay,

Cause of the 'Bad Value' error -

This error occurs when the picklist field referenced in the error message meets each of the following conditions:
 
1- The referenced picklist field has 'Restrict picklist to the values defined in the value set' set to Enabled.
2- The referenced picklist field is a dependent picklist.
3- The page layout does not include both the controlling and dependent picklist fields.
4- A default value is set for the referenced picklist field:
- If the object includes Record Types - This error occurs if the record type sets the default value.
- If the object does not include Record Types - This error occurs if the picklist field sets the value.
- All record types should have the newly create picklist selected in the Selected items section and not under available items.
5- Initiate a Mass Quick Action with Predefined Value Set
6- Any active trigger on the object where the field is used can give the same error.

When you attempt to save a record in the Object that contains this picklist field, Salesforce attempts to populate the default value. Since the controlling value is not set and the picklist is restricted to only allow the dependent values, you will receive this error when you attempt to save the record.


Additional Causes:
- This error can occur when you deploy a picklist field from sandbox and the values are not selected on the record types.
- This error can occur when the value 'Label' and 'API Name' are different in the values, and you use the 'Label' name in the update.

Resolve the 'Bad Value' error -

To resolve this issue, remove the default value from the Record Type or picklist field (depending on where it is set).

 Remove the default value: Record Type 

In Lightning Experience -

Select the gear icon | Setup.
Click Object Manager.
Select the object for the record type that contains the picklist.
Select Record Types.
Select the record type that contains the picklist.
Click Edit for the picklist you wish to change.
In the 'Default' field, select --None--.
Click Save.

In Salesforce Classic -

Select Setup | Customize.
Select the object containing the picklist, then select Record Types.
Click the name of the record type that contains the picklist.
On the picklist of your choice, click Edit.
In the 'Default' field, select --None--.
Click Save.
 
Remove the default value: Picklist

In Lightning Experience -

Select the gear icon | Setup
Click Object Manager.
Select the object that contains the picklist.
Select Fields and Relationships.
Select the picklist field you wish to change.
Click Edit for the picklist value that is set as the Default.
Deselect the 'Default' checkbox. Note: Make this value the default for the master picklist.
Click Save.

In Salesforce Classic -

Select Setup | Customize
Select the object containing the picklist, then select Fields.
Select the picklist field you wish to change.
Click Edit for the picklist value that is set as the Default. 
Deselect the 'Default' checkbox. Note: Make this value the default for the master picklist.
Click Save.

Please mark it as the best answer, if it helps.
Thanks!