web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

2013 setFormNotification issues

(0) ShareShare
ReportReport
Posted on by 95 Most Valuable Professional

Hello everyone.. I am having a few issues by using setFormNotification in Dynamics CRM 2013 (on premise)

I want a form notification with 1 single notification (warning) but it's a 4 line text

now the issues:

- I am trying to insert a string with "newline" in the setFormNotification but it's not working (I tried "\r\n", "\n", "<br></br>", even String.fromCharCode(10) but none of them I got it working.

- so my first try was creating 4 notifications.. but.. I want only 1 icon and not 4 (as it is actually only 1 notification and not 4), so I tried creating by using the type "INFORMATION" or simply ""
After doing this what happened was that the 1st notification (which had the icon) was always going to the last line, which is totally not what want

- so I let all notifications and tried to remove the icon via javascript
here is the code


ShowNotification = function () {

if (mycondition...) {

Xrm.Page.ui.setFormNotification("4th line notitication", "WARNING", "notification04");
Xrm.Page.ui.setFormNotification("3rd line notitication", "WARNING", "notification03");
Xrm.Page.ui.setFormNotification("2nd line notitication", "WARNING", "notification02");
Xrm.Page.ui.setFormNotification("1st line notification", "WARNING", "notification01");

document.getElementById('Notification1').childNodes[0].childNodes[0].childNodes[0].childNodes[0].setAttribute('style', 'visibility:hidden');
document.getElementById('Notification2').childNodes[0].childNodes[0].childNodes[0].childNodes[0].setAttribute('style', 'visibility:hidden');
document.getElementById('Notification3').childNodes[0].childNodes[0].childNodes[0].childNodes[0].setAttribute('style', 'visibility:hidden');
}
else {

Xrm.Page.ui.clearFormNotification("notification01");
Xrm.Page.ui.clearFormNotification("notification02");
Xrm.Page.ui.clearFormNotification("notification03");
Xrm.Page.ui.clearFormNotification("notification04");
}
}

- this almost worked for me, this function is being called both on the events ONLOAD and ONSAVE of the form, and after the ONLOAD event it's working fine but after ONSAVE it works and after it finishes saving the form it's doing kind of a rollback only for the changes I made with document.getElementById..... in other words, the icons are coming back to the notifications

- I also tried another thing, which was instead of creating 4 notifications, I created only the 1st and append the text in the 1st notification.. but the result was the same .. after saving it disappears my changes, in this case it disappears the 3 next lines of notification.. here the code for this one

ShowNotification = function () {

if (mycondition...) {

Xrm.Page.ui.setFormNotification("1st line notitication", "WARNING", "notification01");

document.getElementById('Notification0_text').appendChild(document.createElement("br"));
document.getElementById('Notification0_text').innerHTML += "2nd line notitication";
document.getElementById('Notification0_text').appendChild(document.createElement("br"));
document.getElementById('Notification0_text').innerHTML += "3rd line notitication";
document.getElementById('Notification0_text').appendChild(document.createElement("br"));
document.getElementById('Notification0_text').innerHTML += "4th line notitication";
}
else {
Xrm.Page.ui.clearFormNotification("notification01");
}
}

does anyone has any ideas?

I am doing this notification in a custom entity (6 entities actually and all the same result)

I am testing in both IE 11 and Chrome


thanks in advance

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Oliver Rodrigues Profile Picture
    95 Most Valuable Professional on at
    RE: 2013 setFormNotification issues

    Issue "SOLVED"

    instead of using the setFormNotification I created a field in the top of the form and I am setting my notification manually.

  • Truong Dai Profile Picture
    28 on at
    RE: 2013 setFormNotification issues

    How do you think a notification at forums.bsdinsight.com/index.php

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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
UllrSki Profile Picture

UllrSki 2

#3
SC-08081331-0 Profile Picture

SC-08081331-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans