I have a task to create service appointment dynamically I have a difficulty filling the resources field, I tried with entity reference but still get exceptions, how can I fill that field?
my bad code example
ServiceAppointment newServAppo = new ServiceAppointment();
newServAppo.Resources. = new EntityReference(SystemUser.EntityLogicalName, userId);
OrganizationService.Create(newServAppo);