I have to insert a new record that has a field with of type Picklist (Multi Select), and I get this error trying to insert:
TestValue is a value already added in the values list.
bad value for restricted picklist field: TestValue
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: TestValue: [Categories__c]
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, bad value for restricted picklist field: TestValue: [Categories__c]
The field data type in IDE "Categories__c" is showing String.
I have to run it in a Test Class (@IsTest)
I also found:
Product2.Categories__c.getDescribe().getPicklistValues();
Don't know how I can use it tho.
Thanks in advance.