Search code examples
javascriptdynamics-crmmicrosoft-dynamics

Javascript ReferenceError: Value is not defined


My following function encountered the following error when triggered in Dynamics form.

ReferenceError: heightStart is not defined

function Start(type) {
    debugger;
    alert("Start | type: " + type);
    if (type == "heightStart") {
        var height = Xrm.Page.getAttribute("ccc_heightincmstart").getValue();
        if (height != null && height != "") {
            GetChildInfo(height, type);
        }
        else {
            Xrm.Page.getAttribute("ccc_heightpercentilestart").setValue("");
        }
    }
}

May I know how can I fix this error?

type is a value passed in with Web Resource File Handler mapping. enter image description here


Solution

  • You have to pass parameter with double quotes like “heightStart”

    enter image description here

    Read more