Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Governance and Administ...
Answered

Bulk delete all attachments across all entities

(0) ShareShare
ReportReport
Posted on by 142

Other than Notes entities with a filter of isDocument = True, how to schedule a bulk deletion of all attachment entities?

 

even after running the jobs, attachments are available in different entities.

Curently executing the below SQL Queries with XRMToolBox SQL4CDS utility. 

 

  • Delete from attachment
  • Delete from fileattachment
  • delete from activitymimeattachment
  • delete from activityfileattachment
  • Delete from elasticfileattachment
  • Delete from msdyn_aibfileattacheddata
  • Delete from msdyn_kbattachment
Categories:
  • ChrisPiasecki Profile Picture
    6,389 Most Valuable Professional on at
    Re: Bulk delete all attachments across all entities

    Hi @Mustaque_Ehiya,

     

    Some tables like that one won't be available via Advanced Find or through the UI and need to be interacted with programmatically. Some of the XrmToolBox plugins like you've discovered do this and provide a means to do so. 

     

    You could use Power Automate to do the bulk deletion yourself using the BulkDelete action. Here is a guide on how to do so.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

  • Mustaque_Ehiya Profile Picture
    142 on at
    Re: Bulk delete all attachments across all entities

    Running the below sql query scheduled bulk delete jobs 

    Mustaque_Ehiya_0-1694675720283.png

     

    Mustaque_Ehiya_1-1694675736855.png

     

    I don't see this activity "file attachment" as a configurable entity if I had to schedule directly in the bulk delete page.  Do we have an option to configure the bulk delete of all attachments across entities in CRM itself?

    Mustaque_Ehiya_2-1694675763530.png

     

  • Verified answer
    ChrisPiasecki Profile Picture
    6,389 Most Valuable Professional on at
    Re: Bulk delete all attachments across all entities

    Hi @Mustaque_Ehiya,

     

    Do you have an example of which table/column you're still seeing attachments?

     

    Those tables you listed are mainly for email for email attachments and then a couple of D365 specific ones such as Knowledge Article.

     

    If you're using a custom image or file column, then you'll need to delete from the specific table column that is file/image enabled.

     

    ---
    Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Featured topics