Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Suggested answer

How to cleanup PrincipalObjectAccess (POA) using c# for MS D365 Online?

(0) ShareShare
ReportReport
Posted on by

I want to cleanup or delete rows PrincipalObjectAccess (POA) using c# for MS D365 Online.

Can anyone tell me the steps how to do that using c#?

  • saurabhtiwarii Profile Picture
    on at
    RE: How to cleanup PrincipalObjectAccess (POA) using c# for MS D365 Online?

    You can also evaluate "SQL 4 CDS" with XRM toolbox and use the below reference support article to frame a clean up script.

    Ensure that you run the deletion in small batches using meaningful filters to avoid excessive run duration.

    Supports ::

    - SELECT

    - INSERT

    - UPDATE

    - DELETE

    www.xrmtoolbox.com/.../

    support.microsoft.com/.../how-to-control-principalobjectaccess-table-growth-in-microsoft-dynamic

  • Suggested answer
    Soumen S Profile Picture
    on at
    RE: How to cleanup PrincipalObjectAccess (POA) using c# for MS D365 Online?

    Hi,

    Since you are using online CRM please raise request with Microsoft support for the cleanup. Also please read the below points which can be implemented from your end.

    Best practice:

    Share only what is needed​

    Limiting the amount of sharing that takes place we will reduce the total number of records in the POA table. If users frequently share records with other users, can benefit from setting teams as owners of those records or to have the users share with Teams instead of specific set of users. Share with teams, not users, and use access teams for controlling sharing. â€‹

    ​

    Minimize the number of Business Units where possible​

    Helps reduce the need for sharing records​

    ​

    Ensure users are placed in the appropriate Business Unit​

    A user could maybe be moved further up the Business Unit hierarchy to give them the necessary access to records in another Business Unit​

    ​

    Modify Security to allow users to see information outside of their Business Unit​

    This will also reduce the need for sharing​

    ​

    Once a record does not need to be shared any longer, stop sharing it​

    ​

    Enable the EnableRetrieveMultipleOptimization registry key​

    Enabling this will cause the queries to make use of temp tables​

    Evaluate splitting TempDB out to its own physically separate RAID array​

    =======================================================

    Should look to cleanup up the POA table using Bulk Delete operation.​

    The Bulk Delete job you would create is very similar to proactively maintaining the AsyncOperationBase table via Bulk Delete. â€‹

     â€‹

    1. Go to Settings > Data Management > Bulk Record Deletion and click New.​
    2. Click Next, then on the Define Search Criteria page set the Look for selection to Process Sessions â€‹
    3. Define the criteria for you Bulk Delete.  For example, you could use Status Reason = Completed; Cancelled.​
    4. After defining your criteria, click Next to get to the Select Options page.​
    5. Provide a name, start time, and recurrence pattern, and then click Next.​
    6. Click Submit.​

     â€‹

    If a bulk delete job for Async Operations already exists, or for anything else, ensure that you do not schedule the jobs to run at the exact same time. For example, if you already have a Bulk Delete job that runs nightly, weekly, etc... at midnight; do not also schedule this one to run at midnight. Specify a different time such as 1:00 am instead.​

    https://support.microsoft.com/en-us/topic/performance-is-slow-if-the-asyncoperationbase-table-becomes-too-large-in-microsoft-dynamics-crm-334a0738-e132-1ea7-cab3-7fd68cb823a4 

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans