hello people I am newbie in Power apps portal and I am stuck with Web Apis, I can Update the name of specific account holder by accountid through ajax PATCH call and it works fine, here is my working AJAX call :
webapi.safeAjax({
type: "PATCH",
url: "/_api/accounts(00000000-0000-0000-0000-000000000001)/",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({"name" : "New Account"}),
success: function (res, status, xhr)
{
alert("Entity id: " + xhr.getResponseHeader('entityid'));
},
fail: function ()
{
alert ('FAIL');
}
});
but when I do the same for Opportunity Table, to update Opportunity Name of specific opportunity then I am having this error : error: {code: "9004010C", message: "Resource not found for the segment opportunities.",…}
and here is my AJAX call for opportunity :
webapi.safeAjax({
type: "PATCH",
url: "/_api/opportunities(00000000-0000-0000-0000-000000000002)/",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({"imd_opportunityname" : "New Opportunity"}),
success: function (res, status, xhr)
{
alert("imd_opportunityname : " + xhr);
},
fail: function ()
{
alert ('FAIL');
}
});