Hi,
I want to get following things:
1- Get list of all the records
As we know CRM provide fix number of records in single call. I don't know what is exact count. I want to get all the records even records are 1000000000.
Here is example what I use currently:
function test()
{
//call
var getAllRecords = getAPIRecords(MapEntityUri);
}
//common function
function getAPIRecords(Query) {
var data;
var req = new XMLHttpRequest();
req.open("GET", serverUrl + "/api/data/v8.0/" + Query, false);
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.setRequestHeader("Prefer", "odata.include-annotations=OData.Community.Display.V1.FormattedValue");
req.setRequestHeader("Prefer", "odata.include-annotations=*");
req.onreadystatechange = function () {
if (this.readyState == 4 /* complete */) {
req.onreadystatechange = null;
if (this.status == 200) {
data = JSON.parse(this.response);
}
else {
var error = JSON.parse(this.response).error;
alert(error.message);
}
}
};
req.send();
return data;
}
Can anybody please suggest me any link or solution?
2- How to get count with filter?
I want to get count of records on the base of filter. Please consider above scienario also if there are large number of records.
Can anybody please suggest?
*This post is locked for comments