I a trying to create a service resource by putting resource type as Technician in a test class.
Like below:
List<Map<String, Object>> paramsList = new List<Map<String, Object>>();
ServiceResource serviceResourceRecord
= new ServiceResource(Name=ResourceName
, ResourceType ='Technician'
, RelatedRecordId=relatedUser.Id
, IsActive=true);
insert serviceResourceRecord;
Getting below issue:
System.DmlException: Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, Resource Type: bad value for restricted picklist field: Technician: [ResourceType]
I tried checking allowed values in the pick list:
I am seeing Technician in the pick list of resource type:
How can I create Technician type resource through apex?