Thursday, November 1, 2012

CRM 2011 -sample HTML web resource to get value from CRM

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Test Page </title>
    <script type="text/javascript">
        var Xrm;
        if (window.opener) { Xrm = window.opener.Xrm; }
        else if (window.parent) { Xrm = window.parent.Xrm; }

        onload = function () {
            var myOptionSet = Xrm.Page.data.entity.attributes.get("jmh_flag");
            // var optionSetValue = myOptionSet.getValue();
            var optionSetText = myOptionSet.getText();
            document.bgColor = optionSetText;
            //alert(optionSetValue + " " + optionSetText);
        }

</script>
</head>
<body>

</body>
</html>

No comments:

Post a Comment