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

  • Ray Profile Picture
    Ray 1,480 on at
    RE: MS CRM: Getting CORS Error on access parent Xrm from CRM iframe aspx Page

    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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,387 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans