Reputation: 54022
I am practicing with Microsoft Dynamics CRM 2013 using REST 0Data endpoint with Web Resources.I have added an Iframe in case form and assigned a pagein the IFRAME URL and wrote the code snippet given on Microsoft Website
Now when I open a case from CRM Sales dashboard to check this IFRAME, it showing different errors in different browsers
in Chrome it display the text of the page but gives below error repeatedly
Sandbox access violation: Blocked a frame at "https://diecho.crm5.dynamics.com" from accessing a frame at "https://diecho.crm5.dynamics.com". The frame being accessed is sandboxed and lacks the "allow-same-origin" flag.
in Firefox it display the text and when I open the Only Iframe code in different tab it gives below error in console
NetworkError: 404 Not Found -
https://diecho.crm5.dynamics.com//ClientGlobalContext.js.aspx"Error: Context is not available. { throw new Error("Context is not available."); }
NetworkError: 404 Not Found -
https://s3-eu-west-1.amazonaws.com/987fsdr3e47f993ofskljd9/zone1-1003.js
in IE8 it gives below error:
This content cannot be displayed in a frame To help protect the security of information you enter into this website, the publisher of this content does not allow it to be displayed in a frame.
Please Help me
Upvotes: 0
Views: 4341
Reputation: 365
Tested the same code as MSDN and it worked successfully.
<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>
Upvotes: 0
Reputation: 11
In the Form Editor double click the iframe and make sure that the "Restrict cross-frame scripting, where supported." option is not checked.
Upvotes: 1
Reputation: 768
Since you are accessing OData from HTML page, Xrm.Page.Context
will throw you an error. In place of that you should use parent.Xrm.Page.Context
.
Upvotes: 0