Iam facing an issue with saveEvent.preventDefault() used inside the call back
Eg:
req.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.0/accounts?fetchXml=" + encodedFetchXML, false);
req.onreadystatechange = function () {
if (this.status === 200) {
saveEvent.preventDefault();
}
The data is getting saved but my intention is to NOT TO SAVE the records. I noticed that call back from the Open method is taking a bit time before that the result are getting saved.