web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Blocked a frame with origin "https://examplesite.dynamics.com" from accessing a cross-origin frame in CRM

(0) ShareShare
ReportReport
Posted on by

Hi folks,

What is the issue?

I am unable to access Microsoft dynamics CRM 365 modular selector menus(Sales, opportunity , settings, etc.) from CRM entity form iframe. if i am try to access from iframe to CRM menus, i am getting following error and unable to navigate.

Iframeissue.png

Setting Iframe source like below,

#('iframename').attri('src',"https://sanbox.com");

parent.location = "https://sanbox.com"

CrossBrowserOriginIssue.png

please find out "GREEN COLOR" arrow. I am trying to access CRM menu("crmdevelopment.crm.dynamics.com") from iframe("https://sanbox.com").

how to solve "Blocked a frame with origin from accessing a cross origin" issue.

Kindly help me friends. waiting for your replay in every minute. Thanks in advance. Cheers .

By,

Srinivasan J

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Arpit Shrivastava Profile Picture
    7,518 User Group Leader on at

    I don't think it will allow you to access due to CROSS ORIGIN.

    Can see below article for more info:

    https://community.dynamics.com/crm/f/117/t/232596

    If my answer helped to resolve your issue, kindly verify it by clicking 'Yes'. It would be helpful to the other community members seeking to resolve a similar issue.


    Cheers
    Arpit
    https://arpitmscrmhunt.blogspot.in

     

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Very recent we have been analysed the same issue  in another thread. You may go through it is have shared below.

    You can not open or access external site in a iframe those are restricted from site itself.

    community.dynamics.com/.../273154

  • Community Member Profile Picture
    on at

    Hi Goutam,

    Thanks for the above mentioned suggestion, but that is not help to resolve my issue. Please review my web resource and let me know what mistake i did.

    <html><head>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">

       <title>title</title>

    <script src="ajax.googleapis.com/.../jquery.min.js&quot;></script>

    <script type="text/javascript">

      function RetrieveDomainName()

    {

    console.log("Integration script starts")

    //OData URI to get address information from parent account record

    var oDataURI = window.parent.Xrm.Page.context.getClientUrl()

    + "/XRMServices/2011/"

    + "integrationconfigurationSet";

    var req = new XMLHttpRequest();

    req.open("GET", encodeURI(oDataURI), true);

    req.setRequestHeader("Accept", "application/json");

    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");

    req.onreadystatechange = function () {

    //debugger;

    if (this.readyState == 4 /* complete */) {

    req.onreadystatechange = null; //avoids memory leaks

    if (this.status == 200) {

    //parse the response string as a JSON object into the successCallback method.

    var entityValues = JSON.parse(this.responseText).d;

                                                    console.log(entityValues)

                                                     console.log(entityValues["results"][0].gnh_Domain);

                                                     console.log(entityValues["results"][0].gnh_IntegrationURL);

                                                     console.log(entityValues["results"][0].gnh_name);

     SetUrl(entityValues["results"][0].gnh_Domain,entityValues["results"][0].gnh_IntegrationURL,entityValues["results"][0].gnh_name);

    }

    else {

    //error

    }

    }

    };

    req.send();

    }

    function SetUrl(DomainName,URL,Type)

    {

    if(Type == "URL")

    {

      if(window.parent.Xrm.Page.data.entity.attributes.get("opportunity") != null)

      {

    opp = window.parent.Xrm.Page.data.entity.attributes.get("opportunity").getValue();  

    var userId = window.parent.Xrm.Page.context.getUserId();

    var oppId = opp[0].id;

    console.log("oppIdoppIdoppId" + oppId)

    console.log("useriddddd " + userId)

    var newquoteurl = URL + DomainName +"/mscrm/login.aspx?&userId="+userId+"&opportunityid="+"E"+oppId +"&action=new";

    linktoepr = window.parent.Xrm.Page.data.entity.attributes.get("link").getValue();

    if(link != null)

    {

    $('#iframesale').attr('src',link);

    parent.location = linktoepr;

    }

    else

    {

    $('#iframesales').attr('src',newquoteurl);

    parent.location = newquoteurl;

    }

      }

    }

    }

    </script>

    <meta><meta><meta><meta><meta><meta></head>

    <body>

    <div id="loadingIframe" style="display:block">

    <iframe width="99.5%" height="99.5%" id="iframesales" scrolling="auto" onload="RetrieveDomainName()"></iframe>

    </div>

    </body></html>

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans