Hi
Is it possible to bulk delete the attachments from Notes without deleting the Notes?
Thanks,
*This post is locked for comments
Hi
Attachments are stored within notes records in the documentbody field. When an attachment is uploaded, few other fields also get set value such as isdocument, mimetype, and filename.
If you want to delete an attachment from the note, you will have to clear all the related fields as well.
To delete the attachment you can write your own script or you could use the XrmToolBox plugin - Bulk Data Updater.
You can download XrmToolBox from this link if don't already have : [View:https://xrmtoolbox.com:750:50]
You can use the following Fetch query to query the notes
<fetch distinct="false" mapping="logical" >
<entity name="annotation" >
<attribute name="annotationid" />
<attribute name="mimetype" />
<attribute name="filename" />
<attribute name="documentbody" />
<attribute name="isdocument" />
<order attribute="modifiedon" descending="false" />
</entity>
</fetch>
and then clear the fields by adding them as shown below with values cleared
Once you setup the above fields to clear values, you can then choose the batch size, if you have loads of notes to delete attachments from
If you want to filter the notes, then you can update the FETCH query.
Hope this helps
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6