locked
Javascript error in CRM 2016, in a customfield in header, with a two set option "yes and no" onchange event RRS feed

  • Question

  •  //On change of custom_ProjectConfidentiality
        setConfidentialityFields: function () {
            var projConf = Xrm.Page.getAttribute("custom_projectconfidentiality");
            if (projConf !== null && projConf !== undefined) {
                var projConfValue = projConf.getValue();
                if (projConfValue !== null) {
                    Xrm.Page.getAttribute("custom_dealvalueconfidentiality").setValue(projConfValue);
                    Xrm.Page.getAttribute("custom_buyerconfidentiality").setValue(projConfValue);
                    Xrm.Page.getAttribute("custom_sellerconfidentiality").setValue(projConfValue);
                    Xrm.Page.getAttribute("custom_yieldconfidentiality").setValue(projConfValue);
                    Xrm.Page.getAttribute("custom_propertyconfidentiality").setValue(projConfValue);
                }
            }
        },

        //On change of any of the other fields
        setProjectConfidentiality: function (fieldname) {
            var changedField = Xrm.Page.getAttribute(fieldname);
            if (changedField !== null && changedField !== undefined) {
                var changedFieldValue = changedField.getValue();
                if (changedFieldValue !== null) {
                    var projConf = Xrm.Page.getAttribute("custom_projectconfidentiality");
                    if (projConf !== null && projConf !== undefined && changedFieldValue === true) {
                        projConf.setValue(changedFieldValue);
                    }
                }
            }
        },

    is there any faults in this code ? im a intern, så my javascript skills är still limited.

    Thanks in advance!

    Wednesday, February 22, 2017 10:11 AM