I need to change the owner of the appointment record when creating a new appointment. I use the plugin to create message, and I found this code to assign a new owner to the meeting:
entity = context.PostEntityImages["PostImage"]; ...... AssignRequest request = new AssignRequest(); //request.RequestName request.Assignee = new EntityReference("systemuser", owners.ToList()[0].Id); request.Target = new EntityReference(Appointment.EntityLogicalName, entity.Id); service.Execute(request);
But when I test this, I get the following error: Invalid argument: there must be only one owner for the activity.
I think I need to remove the current owner first and then appoint a new owner. But how can I do this?
Thanks for any help!
source share