Thursday, August 16, 2012

Change Parent System User(Manager) for Specified User

This C# code will set the Parent System User(Manager) of specified System User.

Note: The specified System User and Parent System User must belongs to same Business Unit.

using Microsoft.Crm.Sdk.Messages;

SetParentSystemUserRequest parentUserRequest = new SetParentSystemUserRequest()
{
ParentId = new Guid(managerId.ToString()),
UserId = new Guid(userId.ToString()),
};
SetParentSystemUserResponse parentUserResponse = (SetParentSystemUserResponse)service.Execute(parentUserRequest);


No comments:

Post a Comment