1

我正在使用动态 CRM。我创建了一个 HTML Web 资源并添加到联系人表单中。代码,

<html>
<head>
    <title>OData</title>
    <meta charset="utf-8">
</head>
<body>
    <script type="text/javascript">
        function getAllAttribute() {

            document.getElementById("demo").innerHTML = Xrm.Page.getAttribute();
        }
    </script>
    <button onclick="getAllAttribute();">Attributes!</button>
    <p id="demo">Value will be displayed here</p>
</body>
</html>

现在,当我点击属性时!按钮,demo段落为空,为什么它没有给出页面上所有属性的名称?

4

1 回答 1

0

可以使用window.parent.Xrm.Page.data.entity.attributeswindow.parent.Xrm.Page.getAttribute()代替Xrm.Page.getAttribute();.

见这里:http: //msdn.microsoft.com/en-in/library/gg328474.aspx

于 2014-09-30T05:23:46.373 回答