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)

Xrm.Page.getControl("fieldname").clearNotification() is not working in Dynamics 365?

(0) ShareShare
ReportReport
Posted on by 256

Hi All,

I am using    Xrm.Page.getControl("fieldname").setNotification("Invalid");  for show the error notification on field in JavaScript. It is working fine.

But Xrm.Page.getControl("cyno_startdate").clearNotification() is not working for clear notification in Dynamics 365. 

If, I am using this alert(Xrm.Page.getControl("cyno_startdate").setNotification("Invalid Start Date")). Its return false.

Please suggest any solution ASAP.

Thanks! 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Goutham A Profile Picture
    2 on at

    Actually, Xrm.Page.getControl("fieldname").setNotification("Invalid") should return true.

    Can you once try below code(notifications with uniqueid)

    var uniqueId ="1234" // unique for form

    Xrm.Page.getControl("fieldname").setNotification("Invalid","ERROR", uniqueId );

    Xrm.Page.ui.clearFormNotification(uniqueId)

    Please check if below link helps

    arunpotti.wordpress.com/.../form-level-notifications

    blog.aegissofttech.com/.../how-to-show-form-level-notification-on-any-microsoft-dynamics-crm-page

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Ankit,

    clearFormNotification requires the unique id which you set when you call setNotification.

    You can read more about the signature here -

    msdn.microsoft.com/.../gg327828.aspx

    The above suggested code should work for you.

  • AnkitSinghal Profile Picture
    256 on at

    Hi Goutham,

    I have tried with id also.

    which code you provide this is for showing notification on form but i am working on field notification.

  • AnkitSinghal Profile Picture
    256 on at

    Hi Ravi,

    clearFormNotification  is for form notification. I am using field notification.

    If we using form notification, it show error on field and prevent form from save also.

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi Ankit,

     this works for me(setNotification has two parameters, not 3):

     Xrm.Page.getControl('tcs_testdate').setNotification('Message here', '101');

     Xrm.Page.getControl('tcs_testdate').clearNotification('101');

  • RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Ankit,

    My bad, didn't notice you are using field notification

  • AnkitSinghal Profile Picture
    256 on at

    Hi Alex,

    I have tried it also but its not working in Dynamics 365.

  • AnkitSinghal Profile Picture
    256 on at

    Hi Ravi,

    Its ok. Can we prevent save from setFormNotification?

  • Suggested answer
    ashlega Profile Picture
    34,477 on at

    Hi Ankit,

    it is working for me.. But are you using legacy forms? Disable them if you are and see if that changes anything:) I believe there is a bug (although, I'm not sure if it's specific to the date fields or if it's the same for all types of fields)

  • AnkitSinghal Profile Picture
    256 on at

    Hi Alex,

    I cant disable legacy forms because it will effect my other code.  I am also apply that date time type field.

    Can we use any other alternative solution for this?

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