You have to use either REST or SOAP API to get the latest note of an account record.
below script will get the latest note added on the account record
function GetLatestNote() {
//OData URI to get address information from parent account record
var oDataURI = Xrm.Page.context.getClientUrl()
+ "/XRMServices/2011/OrganizationData.svc/"
+ "AnnotationSet?$select=FileName,NoteText,Subject&$orderby=CreatedOn desc&$top=1&$filter=ObjectId/Id eq guid'"+Xrm.Page.data.entity.getId()+"' and ObjectTypeCode eq 1";
//Asynchronous XMLHttpRequest to retrieve account record
var req = new XMLHttpRequest();
req.open("GET", encodeURI(oDataURI), true);
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.onreadystatechange = function () {
//debugger;
if (this.readyState == 4 /* complete */) {
req.onreadystatechange = null; //avoids memory leaks
if (this.status == 200) {
//parse the response string as a JSON object into the successCallback method.
var note = (JSON.parse(this.responseText).d);
if(note != null )
{
var notetext =note[0].NoteText;
}
}
else {
aler("eeror");
}
}
};
req.send();
}