Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

hii i am getting error "Resource not found for the segment 'ewt_CrateChiledOpportunityAction" while calling action from javascript below is my code .

Posted on by 175
var ewt = ewt || {};
ewt.ewt_CreateChiledOpportunity = function ()
{
    var dual = false;
var parentOpportunityId =null;
var chiledOpportunityId =null;
function Form_onLoad(){
    
        
    }
    function CreateChiledOpportunity(){

var serverURL = Xrm.Page.context.getClientUrl();


var actionName = "ewt_CrateChiledOpportunityAction"; // Global Action Unique Name


//Pass the input parameters of action
var data = {
"parentopportunityid": Xrm.Page.data.entity.getId().replace('{', '').replace('}', '')
};

var req = new XMLHttpRequest();

req.open("POST", serverURL + "/api/data/v9.1/"+actionName, 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 /* complete */ ) {
req.onreadystatechange = null;
if (this.status == 200) {
//You can get the output parameter of the action with name as given below
result = JSON.parse(this.response);

} else {
var error = JSON.parse(this.response).error;
alert(error.message);
}
}
};
//Execute request passing the input parameter of the action
req.send(window.JSON.stringify(data));
}


return {
'Form_onLoad': Form_onLoad,
'CreateChiledOpportunity': CreateChiledOpportunity
    };
}();
Categories:

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans