Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Suggested answer

After the upper and lower levels of the dynamics 365 business department are changed, the rolebase table is cleared

Posted on by 7

The current Version is Dynamics 365 On-Premises v9.1.1.914, there are currently 118 security roles, 213 departments, and about 1,000 users in the system. Recently, the company's organizational structure has been changed, and the operation has been changed to the upper and lower levels of the business department, and the business department has been added. , The rolebase table in the database is emptied, all security roles are gone, query the backup file, this table has accumulated more than 50,000 rows of data
Finally, only the data of the rolebase table can be exported from the test server for recovery, and then it will return to normal. The above operations are verified later, and it is confirmed that the rolebase table will be emptied after the business department is changed or added. So wondering why this is causing this problem and what can I do to fix it

  • bai_xiaofei Profile Picture
    bai_xiaofei 7 on at
    RE: After the upper and lower levels of the dynamics 365 business department are changed, the rolebase table is cleared

    Thanks for your answer!
    Maybe there's a problem with Google Translate, I'm getting my meaning wrong
    Problems will arise after we perform the following operations, which is to adjust the superior department of a business department:

    pastedimage1645321667861v1.png

    Then the RoleBase table in the database will be emptied, and the result of ’select count(*) from RoleBase‘ is 0.
    Even the system deployment administrator has no permission to log in to the system again. We can only restore the RoleBase data in the test system to the production environment to return to normal.
    We trace the above execution process through the SQL Server Profiler tool and trace to a stored procedure: p_ChangeRolesForBusinessMove
    There is a command in this stored procedure to delete the data associated with RoleBase:

    pastedimage1645321675801v2.png

    After we comment out the above command, the problem no longer occurs
    Checked the entire stored procedure and found no exceptions
    But this is definitely not the final solution, we want to know why there is a problem of emptying the entire RoleBase table, and how we can avoid this problem in the future.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: After the upper and lower levels of the dynamics 365 business department are changed, the rolebase table is cleared

    Hi bai_xiaofei,

    Security role versions are specific to business unit.

    pastedimage1645150617923v1.png 

    When we change the user’s business unit, all the current security roles of the users are removed and we need to assign the roles again to the user. This has always been the default behavior. 

    pastedimage1645150994473v2.png

    Now, you have the option to set the behavior for security roles:

    https://docs.microsoft.com/en-us/power-platform/admin/create-edit-business-units#change-the-business-unit-for-a-user 

    pastedimage1645153177096v3.png

    Currently these settings are not available on the Settings UI to modify but these can be edited using the OrgDBOrgSettings community tool available.

    After we have installed the managed solution, we can update the setting and set it as true:

    pastedimage1645153616421v5.png

    Or you can refer following links for more other ways:

    Tip #1134: Moving Users Between Business Units | Power Platform & Dynamics CRM Tip Of The Day

    Update a User’s Business Unit and retain their Security Roles – Ryan Maclean (ryanmaclean365.com)

    Change a User’s Business Unit and retain their Security Roles using Power Automate – Ryan Maclean (ryanmaclean365.com)

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans