Hi community,
By using this concept http://www.powerobjects.com/2015/09/23/dynamics-crm-alert-and-notification-javascript-methods/
i want to customize the notification, when ignore the mandatory field and click on save button, alert message show show the field name which is missed.
Please help !
Regards
Faisal
*This post is locked for comments
Hi Gowtham,
Thanks for correcting. 1 field was missing but now not getting any error nor notification alert on the top screen.
Where will i get the message ?
Make sure you have wrote correct field name in the code. getValue is not getting as control with the field name is not found which you have written.
Hi,
Getting erro. PFA
You can create one function and put the above code inside the function and replace field name. Make sure you need to call the function in the onsave event of the form.
Hi Gowtham,
What is the function name here to use?
Hi Sayed ,
Hope below code will help you -
// Field Notification if (Xrm.Page.ui.controls.get("FieldName") != null && Xrm.Page.ui.controls.get("FieldName") == undefined) { var fieldVal = Xrm.Page.getAttribute("FieldName").getValue(); if (fieldVal != null && fieldVal == undefined) { Xrm.Page.getControl("FieldName").clearNotification(); } else { Xrm.Page.getControl("FieldName").setNotification("Please enter text."); } } //set Form Notification if (Xrm.Page.ui.controls.get("FieldName") != null && Xrm.Page.ui.controls.get("FieldName") == undefined) { var fieldVal = Xrm.Page.getAttribute("FieldName").getValue(); if (fieldVal != null && fieldVal != undefined) { Xrm.Page.ui.clearFormNotification("FormNotifiation1"); // Need to pass unique id which define to set notification in below line } else { Xrm.Page.ui.setFormNotification("Please enter text", "WARNING", "FormNotifiation1"); } }
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156