2014-02-06 153 views
0

我想为crm 2011添加一个标签,该标签显示具有特定样式的表单上可用的一个属性的值。我打算如下操作向crm 2011表单添加标签

  1. 添加一个iframe作为网络资源。
  2. 现在,一旦表单加载完成,请编辑iframe的源属性并将该值作为查询字符串参数追加到它。 3.在html web资源中访问该查询字符串参数并将其设置在标签上。

现在我的问题是:

我可以正常使用javacript(的document.getElementById ...)的iframe里面设置label.I明白解析CRM中DOM 2011表格是不是是否也支持iframe?

回答

1

你可以达到你一样在形式上,通过自定义做parent.Xrm的形式,所以你可以建立一个脚本,如:

// example: grab the "name" field from the form 
// this will only work from inside an IFRAME in the form, of course 
function getName() { 
    var attr = parent.Xrm.Page.getAttribute('name'); 
    if(attr !== null) 
     return attr.getValue(); 
    else 
     return null; 
} 
+0

谢谢你,现在我reply.Let尝试! – atul

+1

非常感谢,它确实有效。 – atul

0

在WebResource内部,您可以使用普通的JavaScript,但是它取决于您使其与您想要支持的所有浏览器兼容。