Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Error 404 when triggering Custom Action

(0) ShareShare
ReportReport
Posted on by 120

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

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans