0

我正在使用带有 Web 资源的 REST 0Data 端点使用Microsoft Dynamics CRM 2013进行练习。我添加了一个 Iframe 以防万一,并在 IFRAME URL 中分配了一个页面,并编写了Microsoft 网站上给出的代码片段

使用代码查看我的 CRM Web 资源的结构

现在,当我从 CRM 销售仪表板打开一个案例以检查此 IFRAME 时,它在不同的浏览器中显示不同的错误

在 Chrome 中它显示页面的文本,但反复给出以下错误

沙盒访问冲突:阻止“https://diecho.crm5.dynamics.com”中的框架访问“ https://diecho.crm5.dynamics.com ”中的框架。被访问的框架是沙盒的,并且缺少“allow-same-origin”标志。

在 Firefox 中它显示文本,当我在不同选项卡中打开 Only Iframe 代码时,它在控制台中给出以下错误

网络错误:404 未找到 -
https://diecho.crm5.dynamics.com//ClientGlobalContext.js.aspx

错误:上下文不可用。{ throw new Error("上下文不可用。"); }

网络错误:404 未找到 -
https://s3-eu-west-1.amazonaws.com/987fsdr3e47f993ofskljd9/zone1-1003.js

在 IE8 中它给出以下错误:

此内容不能在框架中显示为帮助保护您输入本网站的信息的安全性,此内容的发布者不允许其在框架中显示。

请参阅 CRM 2013 中 IE8 中的 IFRAME 错误

请帮我

  • 如何修复这些错误?
  • 在 CRM 或浏览器端启用 IFRAME 中的页面时,我缺少什么?
4

3 回答 3

1

In the Form Editor double click the iframe and make sure that the "Restrict cross-frame scripting, where supported." option is not checked.

于 2013-11-28T16:39:24.363 回答
0

由于您是从 HTML 页面访问 OData,Xrm.Page.Context因此会引发错误。取而代之的是,您应该使用parent.Xrm.Page.Context.

于 2013-11-28T16:19:23.990 回答
0

测试了与 MSDN 相同的代码,并且成功运行。

<html><head>
<title>JQuery REST Data Operations</title>    
<script src="../gap_jscript/jquery.min.js" type="text/javascript"></script>
<script src="../gap_jscript/SDK.JQuery.js" type="text/javascript"></script>
<script src="../gap_jscript/json2.js" type="text/javascript"></script>
<script src="../gap_jscript/TestODATAExample.js" type="text/javascript"></script>
<script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
<meta charset="utf-8">
</head>
<body style="font-family: Segoe UI; background-color: white;">
<button title="Click this button to start the sample." id="start">Start</button>
<button title="Click this button to reset the sample." disabled="disabled" id="reset">Reset</button>
<ol id="output">
</ol>
</body>
</html>
于 2013-12-05T10:29:45.153 回答