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)

Dynamics 365 Online - Field Notification on DateTime field clear not working

(0) ShareShare
ReportReport
Posted on by

Hello,

I have issue with Dynamics 365 ( Version 1612 (8.2.1.271) ), with javascript Field Notification.
On Form I have DateTime field called "new_test" in javascript on FormLoad I'm adding Field Notification, and adding OnChange event on that field. On Event I try to clearnotification but it's not cleared. Problem dosent occur in other Field Type like string, number etc.

Script:

function OnLoad(){

var fieldAttribute = Xrm.Page.getControl('new_test').getAttribute();
Xrm.Page.getControl('new_test').setNotification('req', '101');
fieldAttribute.addOnChange(OnChange);

}
function OnChange(context){

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

}

I traied test clearNotification(..) and clearNotifications()

In additional if user set value on field with some random string like "aaa", and after that choose date from date picker, notification is cleared.

 Problem occurs on Trial version and on client sandbox with installed update to 365.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Nithya Gopinath Profile Picture
    17,078 on at

    Hi,

    Please try using the code below. The clearNotification method doesn't need any parameters.

    Xrm.Page.getControl('new_test').clearNotification();

    See: dynamicsofdynamicscrm.com/.../set-form-and-field-notifications-crm-2013-javascript-new-feature/

    Hope this helps.

  • Community Member Profile Picture
    on at

    Error still occurs even if I use Xrm.Page.getControl('new_test').clearNotification(); or Xrm.Page.getControl('new_test').clearNotifications();

  • Verified answer
    ashlega Profile Picture
    34,477 on at

    Is there an error or is it just that the notification is not cleared? If it's the latter, disable legacy forms..

  • Community Member Profile Picture
    on at

    no error in javascript etc. only notification is still visible and user cannot save form.

    Like you pointed legacy forms are problems here. When I changed rendering form to new TurboForms everything started to work.

    Seems like legacy forms have bug with DateTime FieldNotification after 8.2.x update.

    Thanks for help.

  • Community Member Profile Picture
    on at

    I too have a similar issue but with look up field. Used the code with no success

    any one facing the same issue? is there a way we can find the unique id for this field

  • pratiksoni Profile Picture
    30 on at

    Yeah, I'm facing the same issue on DateTime field.

    Tried to apply the notification ID and then clearing it by the name and the other way mentioned above, but nothing's working for certain reasons.

    if (birthDate > currentDate) {
        fields.birthDate.controls.forEach(function (control) {
            control.setNotification("Birthdate can only be less than or equal to TODAY's date.", notificationId);
        });
    }
    else {
        fields.birthDate.controls.forEach(function (control) {
            control.clearNotification(notificationId);
        });
    }

    Also, the same code is working in unmanaged solution, but when I exported it to managed solution, it is NOT removing the error notification.

    Anyone is able to resolve this issue? 

  • Community Member Profile Picture
    on at

    I have the same Issue right now(( Is anybody found solution?

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