Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Validate whether an attachment is present or not while saving the entity record

(0) ShareShare
ReportReport
Posted on by

Hi All,

I have a scenario where I want to validate whether at least one attachment is present or not before saving the record. While saving, if attachment is not present, then it should stop the user from saving the record giving an alert popup.

If attachment is there, it should read the file and should create the record in the annotation entity.

Generally, the notes section which is used in MS CRM entities, will be enabled only after saving the record. However, I have to attach a file and do validation after the document has been uploaded before saving.

Note: I have the code to create the annotation record when file is validated after saving the record. 

Awaiting your responses and valid suggestions!

*This post is locked for comments

  • Suggested answer
    Guido Preite Profile Picture
    54,077 Moderator on at
    RE: Validate whether an attachment is present or not while saving the entity record

    attachments can be saved only after the record is saved.

    You can (for example) create a field (Record is valid Yes/No) and set initially to No. After the record is created you can check the update (by a plugin) and see if there is an attachment, when there is at least an attachment you set this field to Yes.

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

🌸 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…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the 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 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans