Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to attach files and validate in dynamics CRM 365?

Posted on by Microsoft Employee

I would like to have the ability to attach files to lead/opportunity record in MS Dynamics 365 (CRM) and be able to validate that the files have been attached. The out-of-the-box way of attaching files seems to be using Notes.

I have a custom two-options fields on my lead entity supporting_lead_docs_attached. If a user uploads the files using Notes and sets the supporting_lead_docs_attached filed value to completed, how do i make sure that the user has actually attached a file against supporting_lead_docs_attached?

Is there a way to achieve this behavior using custom js/c# code?

*This post is locked for comments

  • Suggested answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: How to attach files and validate in dynamics CRM 365?

    You might create a plugin to verify this (should probably be an "on update" plugin) - attach it to the lead entity, and, in the plugin, just run a query against the notes to see if there are any notes with file attachments.. then do whatever you want to do (throw an error etc)

    Although, you might probably just create a plugin which will set your checkbox on behalf of the users: that'll be a plugin attached to the notes (annotation entity), and, in that plugin, you would check if there are notes with attachments for the "regarding(lead)".. if there are, you'll set the checkbox on the lead. And you'll need it to run for the create/update/delete messages on the annotation entity

    If you are not familiar with plugin development, you might start here:

    msdn.microsoft.com/.../gg328490.aspx

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to attach files and validate in dynamics CRM 365?

    You can retrieve the related Notes of the lead/opp and check if there are notes attached. To verify, you can ask users to mention something in the name or the file name which you can verify in the plugin.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans