This Javascript snippet on the Street field displays the yellow message the top:
function NotificationTop (msg,type) {
Xrm.Page.ui.setFormNotification(msg, type);
}
I love the customer experience of this message and once it has been added as a Library via Web Resource, it can be reused on many fields by adding it as a Form Library on your form, then implementing it on a field by:
- Clicking the Edit button
- Then in the Parameters box, put your desired message text in quotes, then either ERROR, WARNING, OR INFORMATION as the message type. This last part determines what icon appears; ERROR gets a red X, WARNING gets a exclamation mark, and INFORMATION doesn't show an icon.
With that all said, I would like to improve it to want it to behave similar to what happens when you try to advance in a Business Process Flow without providing the required fields. It has two features:
- Clears after a # seconds
- Has a X so the user can clear it on demand
- Also ... would like it to not appear when the record is first created; in essence, that's not really "on change" but the system is displaying it anyway. I would like it to only show after the record is saved and the user comes back in and changes the address.
How would that Javascript need to change to accommodate 1 thru 3 above?