Hi, I am using this odata query in ms crm 2015 online.
If I am browsing Odata query in explorer, I am able to get results But when I am trying to retrieve it with function, its going to error instead of success call. Please suggest.
var CaseObject = Xrm.Page.getAttribute("oucc_caseparty");
if (CaseObject != null) {
var Case = CaseObject.getValue()[0].id;
}
var CaseAppeal = "";
var odataquery = "http://" + window.location.host + "/" + Xrm.Page.context.getOrgUniqueName() + "/XRMServices/2011/OrganizationData.svc/IncidentSet?$select=oucc_Appeal,Title&$filter=IncidentId eq guid'" + Case + "'";
alert(odataquery);
$.ajax({
type: "GET",
async: false,
contentType: "application/json; charset=utf-8",
datatype: "json",
url: odataquery,
beforeSend: function (XMLHttpRequest) {
XMLHttpRequest.setRequestHeader("Accept", "application/json");
},
success: function (data, textStatus, XmlHttpRequest) {
if (data.d && data.d.results && data.d.results.length > 0) {
CaseAppeal = data.d.results[0].Title;
}
},
error: function (XmlHttpRequest, textStatus, errorThrown) { alert("Transaction not found in the System"); }
});
return CaseAppeal;