web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

How to limit adding to attachments to 5 for notes .

(0) ShareShare
ReportReport
Posted on by 483

Hello,

While adding attachments to notes record how to limit attachments to 5 from front end?

What is the best way to restrict attachments??

I have the same question (0)
  • Verified answer
    meelamri Profile Picture
    13,216 User Group Leader on at

    Hello,

    unfortunately you can do it from front end only with an unsupported way and it's need big effort:

    First, you create new field (attachementsCounter) to count attachement regarding your record. Then a plugin wish will increment this field by 1 when an attachement is created.

    Well, after that you need a JavaScript function. It execute onChange of  the new field (attachementCounter). This function will hide the button (unsupported) you need to manupilate the DOM !!

    Personnally, i will handle this scenario only in the back-end. I will use the field attachementsCounter. If i reach the limit i will throw an exception...

    Mehdi,

    Please tick as verified if the answer is useful. 

  • Suggested answer
    Ankit Sabharwal Profile Picture
    on at

    Hello Partner,

    Hope this post finds you well.

    Unfortunately this configuration is not available in UI yet. In order to achieve it, you can register a plugin in pre create operation of annotation.

    In plugin logic, take the regarding object id and entity type and query the attachments for it. It will give you the collection, if it is greater than 5 then throw business process error that you cannot add more than 5 attachments.

    Make sure your plugin is register on synchronous mode.

    Thanks

    Hope this helps.

    Best regards,

    Ankit

    Please mark as verified if the answer is helpful. Welcome to join hot discussions in Dynamics 365 Forums.

  • Mayank Pujara Profile Picture
    830 on at

    as explained by other ppl earlier ..PreValidate plug in will make sense in this kind of scenario..

    check existing attachment list and if there are more then 5 then throw exception...

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
Martin Dráb Profile Picture

Martin Dráb 60 Most Valuable Professional

#2
#ManoVerse Profile Picture

#ManoVerse 51

#3
Satyam Prakash Profile Picture

Satyam Prakash 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans