We had a requirement to fetch and display data from external hosted service, on a HTML web resource hosted in CRM.
So I created a HTML file with below logic to fetch data from external hosted service.
var xmlhttp = new XMLHttpRequest();
xmlhttp.open(‘POST’, {External Service URL}, false);xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
if (xmlhttp.status == 200) {
// Success
}
}
}
The logic was working fine, when I tested individual HTML fine.
But when hosted in CRM, I was getting “Network Error”.
Reason :
- Cross domain issue while accessing HTML from CRM
Fix :
- Setting “Access data sources across domains” to “true” in IE browser solved the issue

🙂

![[Step by Step] Beginner : Create a PCF control and add it to a custom page](https://rajeevpentyala.com/wp-content/uploads/2024/12/image-49.png)

Leave a comment