web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
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

(0) ShareShare
ReportReport
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

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    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)

  • bai_xiaofei Profile Picture
    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 60 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 36 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans