I am trying to send a POST request to my Web API on a Entity Form Save. The script is run but my function is not being accessed. I am using a XMLHttpRequest to pass an ID to an API controller.
function createSiteRequest () {
var id= Xrm.Page.data.entity.getId();
var url = "site.cloudapp.net/.../Action" + id;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == XMLHttpRequest.DONE) {
alert(xhr.responseText);
}
}
xhr.open('POST',url, true);
xhr.send(null);
}
This seems to be a very basic setup that is working correctly when I use Postman. Does Dynamics restrict requests like this?
Thanks!
*This post is locked for comments