I've added a web resource to opportunities to set a blank default value for a two option field on opportunities. I get this error message, and after clicking OK, the default value is correctly removed. Below is the code (used from https://www.magnetismsolutions.com/blog/11-09-19/No_Default_Value_on_Two_Options_Field_Dynamics_CRM_2011.aspx)
There was an error with this field's customized event.
Field:window
Event:onload
error:undefined
// Set the value of a Two Options / Radio Button to null by default function setTwoOptionNull(twoOption) { var isCreateForm = Xrm.Page.ui.getFormType() == 1; var twoOptionField = Xrm.Page.getAttribute("new_changeorder"); var twoOptionValue = twoOptionField.getValue(); if (isCreateForm) { twoOptionField.setValue(null); // set the value to null on create twoOptionField.setSubmitMode("always"); // required to store the null value // Needed for when you're using a Required 2 Options field - UNSUPPORTED // The first Radio Button must be False, and the Default Value (is by default) document.getElementById("rad_" + twoOption + "1").onclick = function () { // Change the Value, then set it back to trick CRM into thinking its changed if (twoOptionValue == false) { twoOptionField.setValue(true); twoOptionField.setValue(false); } } } }
*This post is locked for comments