MS Crm 2011 javascript iframe功能 [英] MS Crm 2011 javascript Iframe functions

查看:83
本文介绍了MS Crm 2011 javascript iframe功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在MS CRM 2011上遇到了IFrame的问题。我正在尝试生成HTML代码并将其写入IFrame。我对CRM开发很陌生,所以我希望你能引导我找到解决方案。

I'm facing a problem with an IFrame on MS CRM 2011. I'm trying to generate HTML code and write it into an IFrame. I'm quite new to CRM development so I hope you could guide me to a solution.

在我通过JavaScript生成HTML内容(IframeHTML)后,我尝试编写内容到IFrame,然后重新加载整个表格。一切正常,直到我到达最后一个命令

After I generate the HTML content (IframeHTML) via JavaScript I try to write that content to an IFrame and then reload the whole Form. Everything is working fine until I reach my last command

var control = document.getElementById("IFRAME_name");
control.contentWindow.document.open();
control.contentWindow.document.write(IframeHTML);
control.contentWindow.document.close();
control.location.reload(true);

脚本在Form的OnLoad上执行,但它给我一个警告

The script is executed on OnLoad of the Form, but it gives me an alert that


访问被拒绝

Access is denied

最后。

如果我将第一行替换为:

If I replace the first line with :

var control = Xrm.Page.ui.controls.get("IFRAME_name");

它告诉我


不支持文件。

Document is not supported.

我不确定我是否认识到这里的问题所以任何帮助都会是很好。

I'm not sure if I recognized what the problem here is so any help would be nice.

推荐答案

您必须在IFRAME属性中激活Crossframe Scripting。

You have to activate Crossframe Scripting in the IFRAME properties.

你做过吗?

关于Xrm.Page调用,你可以使用

Regarding the Xrm.Page call, you can get the IFRAME using

var control = Xrm.Page.ui.controls.get("IFRAME_name").getObject();

这是获得IFRAME的支持方式,所以你应该使用它。

This is the supported way to get the IFRAME, so you should use that.

这篇关于MS Crm 2011 javascript iframe功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆