Below is the C# code helps you to change the Business Unit of the specified System User in Microsoft Dynamics CRM 2011.
using Microsoft.Crm.Sdk.Messages;
SetBusinessSystemUserRequest request = new SetBusinessSystemUserRequest();
request.BusinessId = new
Guid(businessUnitId.ToString());
request.UserId = new
Guid(systemUserId.ToString());
request.ReassignPrincipal = new EntityReference("systemuser", systemUserId);
SetBusinessSystemUserResponse response = (SetBusinessSystemUserResponse)service.Execute(request);
No comments:
Post a Comment