Web resource method does not exist

0
79
Forum Post: Change the Filter On option on Opportunity Associated View for Account form


Hi All,

When I load the form my js getting as Error :Web resource method does not exist : function name.

I tried for different entities but same error I’m getting.

Can some onehelp me in resolving the below error

please find the below code: for reference

function contactRetrival(executionContext) {
var formContext = executionContext.getFormContext();
debugger;
if (formContext != null && formContext != undefined) {

var fetchcxml = “<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’>” +
” <entity name=’contact’>” +
” <attribute name=’fullname’ />” +
” <attribute name=’telephone1′ />” +
” <attribute name=’contactid’ />” +
” <order attribute=’fullname’ descending=’false’ />” +
” </entity>” +
“</fetch>”;
var req = new XMLHttpRequest();
req.open(“GET”, Xrm.Utility.getGlobalContext().getClientUrl() + “/api/data/v9.2/contacts?fetchxml=” + encodeURI(fetchxml), true);
req.setRequestHeader(“OData-MaxVersion”, “4.0”);
req.setRequestHeader(“OData-Version”, “4.0”);
req.setRequestHeader(“Content-Type”, “application/json; charset=utf-8”);
req.setRequestHeader(“Accept”, “application/json”);
req.setRequestHeader(“Prefer”, “odata.include-annotations=*”);
req.onreadystatechange = function () {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var results = JSON.parse(this.response);
console.log(results);
for (var i = 0; i < results.value.length; i++) {
var result = results.value[i];
// Columns
var contactid = result[“contactid”]; // Guid
alert(contactid);
}
} else {
console.log(this.responseText);
}
}
};
req.send();

}
}



Source link

Leave a reply

Please enter your comment!
Please enter your name here