我正在使用动态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
段落为空,为什么它不给出页面上所有属性的名称?
可以使用window.parent.Xrm.Page.data.entity.attributes
或window.parent.Xrm.Page.getAttribute()
代替Xrm.Page.getAttribute();
。
看到这里:http : //msdn.microsoft.com/en-in/library/gg328474.aspx
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句