为什么getAttribute返回null?

普尼尼·科塔里(Pranit Kothari)

我正在使用动态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段落为空,为什么它不给出页面上所有属性的名称?

Suchit kumar

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

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

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章