Skip to main content

Notifications

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

  • 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

Announcing the Engage with the Community forum!

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 54

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans