【问题标题】:Adding a label to crm 2011 form向 crm 2011 表单添加标签
【发布时间】:2014-02-06 11:18:56
【问题描述】:

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

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

现在我的问题是:

我可以在 iframe 内使用普通的 javacript (document.getElementById ...) 来设置标签吗?我知道不支持在 CRM 2011 表单中解析 DOM。在 iframe 内也不支持吗?

【问题讨论】:

    标签: iframe dynamics-crm-2011


    【解决方案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;
    }
    

    【讨论】:

    • 感谢您的回复。让我现在试试吧!
    【解决方案2】:

    在 WebResource 中,您可以使用普通的 javascript,但您可以自行决定使其与您想要支持的所有浏览器兼容。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-04
      • 1970-01-01
      • 2011-03-08
      • 1970-01-01
      • 2013-07-13
      • 1970-01-01
      相关资源
      最近更新 更多