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 : zAxHJ1p5a7viyEk4H4qxNg
Power Apps - Power Apps Governance and Administ...
Answered

Bulk delete all attachments across all entities

Like (0) ShareShare
ReportReport
Posted on 9 Sep 2023 08:23:04 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:
I have the same question (0)
  • ChrisPiasecki Profile Picture
    6,412 Most Valuable Professional on 16 Sep 2023 at 15:24:15
    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 14 Sep 2023 at 07:19:04
    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,412 Most Valuable Professional on 10 Sep 2023 at 21:08:55
    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

Responsible AI policies

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

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 936 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 375 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 330 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Loading complete