Hi there,
When attempting to save a changed value in a custom entity, we have a script set to execute that should check the value of a field and if the field is 100, a notification warning should be displayed on the form. The field is set by a business rule, triggered from another field (a drop down option set). Unfortunately, when we click save on the form, we get an undefined error:
There was an error with this field's customized event.
Field:crmForm
Event:onsave
Error:undefined
Here is the code in question:
function formNotification()
{
//check if the value is Critical
if (Xrm.Page.getAttribute("new_criticalityvalue").getValue() = 100)
{
//set the notification with an error icon
// Xrm.Page.ui.setFormNotification("Warning! If you choose critical, you commit that this Idea must be completed or this specific Opportunity is completely DEAD. You are also committing to a > 50% PoA if this Idea is implemented. ", "WARNING", "critical");
// }
// else
// {
//clear the notification
// Xrm.Page.ui.clearFormNotification("critical");
}
}
Is there anything that I need to change in the code? I checked the name of the field "new_criticalityvalue" and it's accurate.
Thank you for your help!
Best Regards,
Eric