Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How can I change BusinessUnit to SystemUser without reassinging

Posted on by 45

Hello professionals!

Please help me with this action. 

I need to change BusinessUnit of SystemUser - but do it without reassing entities. 

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How can I change BusinessUnit to SystemUser without reassinging

    I didn't change BU of a user using code before. When you do it using UI - system doesn't suggest reassignee.

    What's wrong with reassigning to the same user? I'm afraid there is no other way to reassign BU of the user that you use.

  • NickGrava Profile Picture
    NickGrava 45 on at
    RE: How can I change BusinessUnit to SystemUser without reassinging

    Hello!

    I use this code to change BU now:

    SetBusinessSystemUserRequest req = new SetBusinessSystemUserRequest();
    //business unit to assign user to
    req.BusinessId = _BU;
    //user to re-assign
    req.UserId = _FindUID;
    //can be a different team or systemuser, used to reassign records owned by person
    //6300040D-2106-E611-80C6-000C296C5B0A
    req.ReassignPrincipal = new EntityReference("systemuser", _FindUID);
    try
    {
    //Program.logger.Info(string.Concat("change bu"));
    service.Execute(req);
    }
    ...

    It works but ReassignPrincipal reassign all records owned by UserId - to _FindUID. Even if UserId = _FindUID.

    So the question is - how to disable reassign? 

    Or use another method to change BU...

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How can I change BusinessUnit to SystemUser without reassinging

    Hello,

    What do you mean with "reassign entities"?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans