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

Announcements

Community site session details

Community site session details

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

Document delete in Dynamics does not store document in the Recycle Bin

(1) ShareShare
ReportReport
Posted on by
Hi there,
 
There seems to a difference between deleting from the Documents tab in CRM vs deleting from the same Document library via SharePoint online:
  • Deleting via SharePoint Online (through the contact Document Location) does a soft-delete and moves the file to the Recycle Bin
  • Deleting via Documents tab (on a contact) does a hard-delete without moving the deleted file to the Recycle Bin
I am building a cloud flow “When a file is Deleted” to retrieve the contact from the deleted file in the Recycle Bin so that I fetch the previous CV from the Contact’s document folder. (Note: the “When a file is Deleted” action does not have the contact information, only the file name (so the only way is through the recycle bin).
 
I have verified this behavior on a default Dynamics Sales environment without any custom solutions/plugins.
 
Additionally I found this posts in the forum dating from 2017 and 2018 without any answer:  https://community.dynamics.com/forums/thread/details/?threadid=1092a8c8-f925-480c-b69a-22c61f78d42a
https://community.dynamics.com/forums/thread/details/?threadid=c62f90fc-9217-404a-badc-d23fd357157c
 
Can anyone verify that this is a known defect or planned to be resolved in a future release? Any workaround suggestions would be very much appreciated.
 
Best regards,
Geron Profet 
I have the same question (0)
  • SH-13022140-0 Profile Picture
    2 on at
    3 Years later and it appears that this is still the case. When deleting in Dynamics 365, there are no records in the Site Retention Recycle Bin or in the Second-stage recycle bin. Kind of defeats the point of having a recycle bin feature in SharePoint if Dynamics is sending a full purge request when deleting from CRM. Not sure how this was overlooked. Will Microsoft plan on adding settings to SharePoint integration in Dynamics 365 to allow for soft-deletion?
  • Suggested answer
    Suriyanarayanan V Profile Picture
    125 on at

    This behaviour is expected (although admittedly confusing) and has been consistent for many years across Dynamics 365 + SharePoint integration.

    Why the behaviour is different

    When you delete a document from SharePoint Online, the deletion is handled entirely by SharePoint’s native file system logic, which performs a soft delete and moves the file to the site’s Recycle Bin.

    When you delete a document from the Documents tab inside Dynamics 365, the deletion is performed through the SharePoint REST API using the /recycle=false flag, which results in a hard delete.
    This bypasses the Recycle Bin completely.

    This is not a defect in the integration — it’s simply how the Dynamics 365 → SharePoint API call was originally implemented, and it has never been changed.

     

    💡 Workarounds

    Unfortunately, because Dynamics performs a hard delete, the file never enters the Recycle Bin — so your flow cannot trigger on it.

    Here are the practical options:

    1. Prevent users from deleting via Dynamics

    This is the most reliable workaround.

    • Remove the Delete privilege on the SharePoint Document entity (Document Location / Annotation depending on your setup).

    • Or hide the delete button using a Ribbon rule.

    Users would then delete only through SharePoint, ensuring soft-delete behaviour.

    2. Use SharePoint versioning instead of relying on the Recycle Bin

    If your goal is to retrieve the previous CV:

    • Enable major/minor versioning on the document library.

    • When a file is deleted from Dynamics (hard delete), you cannot recover it.

    • But when a file is replaced or updated, you can always retrieve the previous version.

    This doesn’t solve the delete scenario but often solves the underlying business requirement.

    3. Intercept deletion using a custom approach

    If you absolutely must capture deletes triggered from Dynamics:

    • Replace the delete button with a custom command that calls a Power Automate flow or plugin.

    • The custom logic can:

      • Move the file to a “Deleted” folder,

      • Or call the SharePoint API with recycle=true,

      • Or log the deletion before performing it.

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Tom_Gioielli 58 Super User 2026 Season 1

#2
Eugen Podkorytov Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Eugen Podkorytov 49

#3
Fiona_Tiernan Profile Picture

Liquid error: Object of type 'Adxstudio.Xrm.Web.Mvc.Liquid.EntityReferenceDrop' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Liquid error: Object of type 'System.Boolean' cannot be converted to type 'System.String'. Fiona_Tiernan 22 Moderator

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans