You will need to use webapi. The following is a sample for retrieving a value from the user entity. Change the following using your id field and your entity.
You can also download and use CRM Rest Builder to generate Web Api requests.
function GetUserInfo(userId) {
var clientUrl = Xrm.Page.context.getClientUrl();
var req = new XMLHttpRequest();
req.open("GET", clientUrl() + "/api/data/v8.2/systemusers(" + userId + "?$select=new_MyFieldName", false);
req.setRequestHeader("OData-MaxVersion", "4.0");
req.setRequestHeader("OData-Version", "4.0");
req.setRequestHeader("Accept", "application/json");
req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
req.onreadystatechange = function() {
if (this.readyState === 4) {
req.onreadystatechange = null;
if (this.status === 200) {
var result = JSON.parse(this.response);
var customFieldValue = result["new_MyFieldName"];
}
else {
Xrm.Utility.alertDialog(this.statusText);
}
}
};
req.send();
}
Hope this helps.