locked
Changing the Business Unit for a User RRS feed

  • Question

  • I am retrieving a Business Unit with the following LINQ query:

    Curtis.Xrm.

    businessunit bu = (from x incrm.businessunits wherex.name == strBU select x).SingleOrDefault();

    Curtis.Xrm.

    systemuser user = (from z incrm.systemusers wherez.domainname == strCompare select z).SingleOrDefault();

    I am trying to change the business unit the user is associated with like the following:

    user.businessunitid = bu.businessunitid;

    xrm.UpdateObject(user);

    xrm.SaveChanges();

     

    But I don't see the changes in CRM. Is there anything I am doing wrong?

    Please advise!

    Thursday, March 24, 2011 9:45 PM

Answers

  • Hi Basani,

    There is a restriction that we will not able to update Business Unit for the User through Code.

    ValidforUpdate Option for Business Unit is No(Check SDK Systemuser attributes)

    regards,

    Kannan B

    • Proposed as answer by Kannan Boopalan Friday, March 25, 2011 5:14 AM
    • Marked as answer by Basani Friday, October 7, 2011 12:24 PM
    Friday, March 25, 2011 5:13 AM