locked
Accessing Xrm Context from HTML WebResource outside CRM in CRM 2013 version RRS feed

  • Question

  • Hi Guys,

    I am facing issue while accessing Xrm context from Html WebResource which is opened outside CRM. here is my code below(Same code works fine in CRM 2011, its not working when I move it to CRM 2013 version).

    Contact Form On-load:

    window.open("http://MyCRMServerName/XYZ-Org/WebResources/new_Test.htm");

    New_Text.html Script:

    <html><head></head><body bgcolor="#f6f8fa">
    <script src="../WebResources/new_jquery.js" type="text/javascript"></script>
    <script src="../WebResources/jquery_1.9.1.min.js" type="text/javascript"></script>
    <script src="../WebResources/new_json" type="text/javascript"></script>
    <script src="../ClientGlobalContext.js.aspx" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function () {
            onLoad();
        });

        function onLoad() {
            if (window.top.frames.opener) { Xrm = window.top.frames.opener.Xrm; }
            else if (window.parent) { Xrm = window.parent.Xrm; }
        }
    </script>
    </body></html>

    Am getting "Permission Denied" error while trying to access Xrm Context. Any help here? Thanks in Advance!

    Thursday, September 4, 2014 7:41 PM