Showing posts with label null value in option. Show all posts
Showing posts with label null value in option. Show all posts

Friday, April 11, 2014

No Default Value on Two Options Field Dynamics CRM 2011

function setTwoOptionNull(twoOption) {
    var isCreateForm = Xrm.Page.ui.getFormType() == 1;
    var twoOptionField = Xrm.Page.getAttribute(twoOption);
    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
        document.getElementById("rad_" + twoOption + "1").onclick = function () { 
            if (twoOptionValue == false) {
                twoOptionField.setValue(true);
                twoOptionField.setValue(false);
            }
        }
    }
}

pass the value "new_acceptreject" as shown below