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 :
Microsoft Dynamics CRM (Archived)

Deleting attachments from Notes

(0) ShareShare
ReportReport
Posted on by 85

Hi

Is it possible to bulk delete the attachments from Notes without deleting the Notes?

Thanks, 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Kokulan Profile Picture
    18,054 on at
    RE: Deleting attachments from Notes

    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]

    0246.ScreenClip-_5B00_218_5D00_.png

    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

    0246.ScreenClip-_5B00_218_5D00_.png

    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

    ScreenClip-_5B00_217_5D00_.png

    If you want to filter the notes, then you can update the FETCH query.

    Hope this helps

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#2
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans