Hey people!
I currently have a problem and I am getting pretty frustrated.
I developed a Plugin, which will be triggered by a custom action, which will be triggered by the following Javascript:
function triggerOpportunityQuotationPlugin()
{
var data = {
"ReportSvrUrl_Output": "test"
};
var Id = Xrm.Page.data.entity.getId();
var clearId = Id.replace(/{|}/g,"");
var serverURL = Xrm.Page.context.getClientUrl();
var emailGuid = null;
var req = new XMLHttpRequest();
var fullURL = serverURL + "/api/data/v8.0/opportunities(" + clearId + ")/Microsoft.Dynamics.CRM.itg_newopportunityquotetrigger";
alert(fullURL);
req.open("POST", fullURL, true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.onreadystatechange = function()
{
if (this.readyState == 4)
{
req.onreadystatechange = null;
if (this.status == 200)
{
alert("Request erfolgreich!")
var result = JSON.parse(this.response);
alert(result);
Xrm.Page.getAttribute("itg_emailguid").setValue(result.EmailGUID);
alert(result.emailGUID);
openEmail(result.EmailGUID);
}
else
{
alert("Request Error!");
alert(this.response);
var error = JSON.parse(this.response).error;
alert(error.message);
}
}
};
req.send(window.JSON.stringify(data));
}
Everything worked fine in my DEV Enviroment and also in the Testenviroment from the customer which is a direct copy of the current Production Enviroment.
Now that i implemented everyting in Production, my Javascript is not able to trigger the Custom Action and i get an Error: "The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable."
Does somebody know what could cause this? Do I have to set some Secrity related configurations? Is it because of specific options in my browser?
When I debug the whole thing, the "this.status" is always 404 so the success block will never be executed.
Thanks in advance!
*This post is locked for comments