Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

how to show default validation error message for HTML web resource

Posted on by Microsoft Employee

Hi ,

I've created a HTML web resource and added to Contact form . I want to show error message like the default mandatory field error message in MSCRM. Is there any best way to achieve this?

Thanks,

Mani.

*This post is locked for comments

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: how to show default validation error message for HTML web resource

    That code would not work for webresoruce control. Alternatively you can use form notifications - msdn.microsoft.com/.../gg327828.aspx

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to show default validation error message for HTML web resource

    I tried with this below code but no luck.

    this method working for custom fields but not working for HTML Webresource

    parent.Xrm.Page.getControl("WebResource_<name>").setNotification("This is a notification about the Fax field");


  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to show default validation error message for HTML web resource

    Hi,

    maybe you can adapt your html to work with SparkelXRM (www.sparklexrm.com/.../default.html). It has the samelook and feel as CRM UI

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: how to show default validation error message for HTML web resource

    If it's Html webresource you will have to design own alert mechanisms instead of using standard. Good luck.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: how to show default validation error message in web resource

    Thanks for your reply Pankaj Pandey,

    But i've created "Html web resource" instead of custom field.

  • Suggested answer
    Panky Profile Picture
    Panky 155 on at
    RE: how to show default validation error message in web resource

    You can add the attribute name in the below "" and it will show the default mandatory field error message.

    Xrm.Page.getAttribute("Attribute").setRequiredLevel("required");

    Please mark it as "Verified", if it's the answer you are looking for.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans