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 CRM (Archived)

All required field validation errors should be shown form level not field level

(0) ShareShare
ReportReport
Posted on by 539

Hi 

We have a client requirement, says all required field validation error should be shown all at form level using SetFormNotification.  If multiple required fields doesn't answered, on save, each field shows error message one y one. Instead of that, all error messages should be visible on Form top by using SetFormNotificaiton.

I attached onSave function to Form onSave envent. But some how, Onsave is not triggering until all required fields are answered. Is there a way to suppress on field level errorr or also show all error on Form level.

I thought to remove Business required from attribute, but wants to keep that. 

*This post is locked for comments

I have the same question (0)
  • Aileen Gusni Profile Picture
    44,524 on at

    Hi hello,

    You cant supress it without you set is to Optional.

    So set all to Optional.

    Then you use javascript to dynamically set is required.

    The Form Onsave event is to validate before save, so it wont be triggered after saving.

    So if you have required field it will stop CRM form to save, you need to set them optional then only after that you set to required.

    Thanks

  • hellosuresh Profile Picture
    539 on at

    Thanks for the answer. Let me try the solution you mentioned.

  • Community Member Profile Picture
    on at

    Have you thought of using Business Rules to show error messages rather than making fields required? This still prevents save, but also shows the error message next to the field and next to the save button (so this is at form level, albeit not all at once as notifications).

    Also, why not use onChange events to validate fields and if they have missing or unsuitable values, show the notification then, why wait until save? (I would avoid doing these onLoad, though).

  • hellosuresh Profile Picture
    539 on at

    HI Adam,

    Thanks for response.

    Client needs to show all required error messages on top of form, while on save. Client is okay to show error at field level. But during on save, instead of show each one at a time, client need to see all at once, so that he/she can take action.

    Event though we use business rule it is same functionality.

    Regarding Onchange event, if field not get focused(I mean no text entry/selection done) how can we trigger onChange event.

    As Aileen mentioned, I set field as optional.  on form load I set as required. Still it acts like OOB functionality, prevent to hit OnSave event, if any unanswered required fields find, system focus that field.

    I appreciate all of your time.

  • Suggested answer
    Aiden Kaskela Profile Picture
    19,696 on at

    Hi,

    I think the problem is that you need a required field that behaves like an optional field. You could set your "required" fields to be requirement level = Business Recommended, that will let the form pass its validation and fire your js event. In your JS you could look for any fields that have a requirement level of Recommended and don't have a value, and you would know this is a field missing data. Then you set your error message on the form and cancel the save event. This should give you the appropriate behavior.

    Hope this helps! I'd appreciate if you'd mark this as a Verified answer.

    Thanks,

     Aiden

  • Community Member Profile Picture
    on at

    We have a client requirement, says all required field validation handel by client.

    When client wish to be disbale/enable the validation . They want to be option to handel the validation.

    Is ther any way to do all things  using javascript. Please help me out

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 CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans