Regarding "clears after X seconds", I modified the JS so it could receive parameters like this:
function DisplayNotification() {
var time = 3000; //Display time in milliseconds
//Display the notification
Xrm.Page.ui.setFormNotification(message, type);
//Wait the designated time and then remove
setTimeout(
function () {
Xrm.Page.ui.clearFormNotification();
},
time
);
}
And I passed in two parameters on the Event Handler.:
'Message','WARNING'
I figured I could drop id since it's on the field it needs to function on.
But nothing happens. Rookie, I am.
This is what it was before my modification:
function DisplayNotification() {
var message = "Useful message to the end user";
var type = "INFO"; //INFO, WARNING, ERROR
var id = "Info1"; //Notification Id
var time = 3000; //Display time in milliseconds
//Display the notification
Xrm.Page.ui.setFormNotification(message, type, id);
//Wait the designated time and then remove
setTimeout(
function () {
Xrm.Page.ui.clearFormNotification(id);
},
time
);
}