locked
Setting user's Business unit programmatically RRS feed

  • Question

  • I have a need to update user's Business Unit using CRMService. How can I accomplish this?

    Friday, March 19, 2010 2:21 AM

Answers

  • Hi

    You should use SetBusinessSystemUserRequest to perfrom this action like below

    // Create the request object.
    SetBusinessSystemUserRequest user = new SetBusinessSystemUserRequest();

    // Set the properties of the request object.
    user.BusinessId = new Guid("97110FB7-84A1-DB11-BEB5-0013727B635D");
    SecurityPrincipal assignee = new SecurityPrincipal();
    assignee.PrincipalId = new Guid("59727AF6-09A0-DB11-BEB5-0013727B635D");
    user.ReassignPrincipal = assignee;
    user.UserId = new Guid("59727AF6-09A0-DB11-BEB5-0013727B635D");

    // Execute the request.
    SetBusinessSystemUserResponse assigned = (SetBusinessSystemUserResponse) service.Execute(user);

    Regards
    Vinoth

    • Proposed as answer by VinothBalasubramanian Friday, March 19, 2010 7:46 AM
    • Marked as answer by shiil Monday, March 22, 2010 9:02 PM
    Friday, March 19, 2010 7:43 AM