[CRM] Aggiungere/Rimuovere user dai Team via codice

public void AddUserToTeam(Guid teamId, Guid userId)
{
CrmService service = new CrmService();
service.Credentials = ......passare credenziali di amministratore

AddMembersTeamRequest addRequest = new AddMembersTeamRequest();
addRequest.TeamId = teamId;
addRequest.MemberIds = new Guid[] { userId };

AddMembersTeamResponse addResponse =
(AddMembersTeamResponse)service.Execute(addRequest);
}

public void RemoveUserForTeam(Guid teamId, Guid userId)
{
CrmService service = new CrmService();
service.Credentials = ......passare credenziali di amministratore

RemoveMembersTeamRequest remove = new RemoveMembersTeamRequest();

remove.TeamId = teamId;
remove.MemberIds = new Guid[] { userId };

RemoveMembersTeamResponse removed = (RemoveMembersTeamResponse)service.Execute(remove);

}
«maggio»
domlunmarmergiovensab
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789