Hello!
basically, I want to achieve to write back the data into CRM from a custom grid on the MS Portal. I tested first one simple ajax call but it was rejected. Is it possible to get a client side context within JavaScript in MS Portal?
Please check the code below.
function test_ajax() {
//debugger;
var url2 = "adxportal1.crm4.dynamics.com/.../AccountSet"
var account = {};
account.Name = "Sample Account";
var jsonAccount = window.JSON.stringify(account);
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
datatype: "json",
url: url2,
data: jsonAccount,
beforeSend: function (XMLHttpRequest) {
//Specifying this header ensures that the results will be returned as JSON.
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
account = data.d;
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(errorThrown);
}
});
}

*This post is locked for comments
I have the same question (0)