Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to show validation errors on forms using plugins

Posted on by 676

Hi,

How can I show validation errors on forms using plugins? I want to run this plugin on update and show a validation error after the plugin runs, if the user enters incorrect data.

*This post is locked for comments

  • Rajat Awasthi Profile Picture
    Rajat Awasthi 675 on at
    RE: How to show validation errors on forms using plugins

    Hi Tahir ,

    You can use Actions with Plugins. Please refer below link for help.

    missdynamicscrm.blogspot.in/.../crm-2013-utilize-custom-action-as.html

  • Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: How to show validation errors on forms using plugins

    Hi Moh,

    If you want to use show only the notification, you can just use throw new invalid plugin exception.

    If you want to "convert" and show it as form notification

    Hope my old blog post can help:

    missdynamicscrm.blogspot.sg/.../convert-crm-plugin-message-to-crm-alert-form-notification-javascript-from-plugin-csharp.html

    THanks

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to show validation errors on forms using plugins
    [deleted]
  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to show validation errors on forms using plugins

    Hi Tahir,

    You can update validation details in a field within form itself. Using that field value, you can display it as form notifications with the help of javascript which should be implemented onload event of form.

    www.powerobjects.com/.../dynamics-crm-alert-and-notification-javascript-methods

    Mansoor

  • Mohd Tahir Profile Picture
    Mohd Tahir 676 on at
    RE: How to show validation errors on forms using plugins

    Hi Saad,

    I want to show the error message to the user on the form.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to show validation errors on forms using plugins

    You can use try and catch block and throw invalid exception message in the catch block

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