below is my json where i am inserting the case record.
Status is standard field and the values are (New,Working,closed).
but if send the values other than the above values in json ,still its creating the records,but i wanted to throw an error. in custom field if i choose restricted picklist option its trwoing an exception,but not for standard picklist values. Please suggest
{
"status" : "N",
"origin" : "AIMS",
"Custom_picklist":"Not allowed"
}
globalDesesr(string picklst){
Schema.DescribeFieldResult fieldResult =case.picklst.getDescribe();
List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
set <String> allOpts = new set <String> ();
for(Schema.picklistEntry f:ple)
{
allOpts.add(f.getValue());
}
return allOpts;
}