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 :
Customer experience | Sales, Customer Insights,...
Unanswered

MS CRM: Getting CORS Error on access parent Xrm from CRM iframe aspx Page

(0) ShareShare
ReportReport
Posted on by 5

We are upgrading our CRM environment from 8.2 to 9.1. We have few modules in the System which are having Iframe loading web application(having aspx pages) on the CRM record.

Basically the issue is that we are unable to access parent.Xrm object inside aspx page of my web application to populate the CRM form fields from web application data.

For example: in the below screenshot when user clicks on the Select button it should populate the values of the selected row on the CRM form.

CRM Url: https://crmserver/TestOrg

Web Application: https://crmserver:4444/Home.aspx 

CRM form:

pastedimage1684406281763v1.png



Javascript in the ASPX Page:

function PostBackToCrm(){

    parent.Xrm.Page.getAttribute('name').setValue('ABC');

    parent.Xrm.Page.getAttribute('address').setValue('123ABC');

    parent.Xrm.Page.getAttribute('phone').setValue('1234567');

}

 

We are getting Cors Error at parent.Xrm in browser:

Uncaught DOMException: Blocked a frame with origin "https://crmserver:4444" from accessing a cross-origin frame

We have tried adding below settings in both CRM web.config and Webapplication web.config files but it is not working

pastedimage1684406335429v2.png

Note: We cannot convert Web application to html Web resource as there is a lot of logic in Web application and it needs a lot of redesigning work.

Earlier users were using IE hence we didn’t get CORS issues. We are getting CORS errors with latest browsers

I have the same question (0)
  • Ray Profile Picture
    1,537 on at

    First make sure you unchecked the option in webresource: Select whether to restrict cross-frame scripting.

    pastedimage1684485900056v1.png

    and read about this learn.microsoft.com/.../enabling-cross-origin-requests-in-web-api.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 81 Super User 2025 Season 2

#2
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 49 Most Valuable Professional

#3
#ManoVerse Profile Picture

#ManoVerse 40

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans