Yes , the code below works perfect for me.
function CalculateRollupField(EntityName, recGuid, RollUpFieldName)
{
recGuid = recGuid.replace("{", "").replace("}", ""); // String Guid
var HttpReq = new XMLHttpRequest();
HttpReq.open(this.method, this.url, true); // Need this to initiate the request
HttpReq.setRequestHeader("OData-Version", "4.0");
HttpReq.setRequestHeader("OData-MaxVersion", "4.0");
// Double Check your API URL, may differ for v9.0
HttpReq.open("GET", Xrm.Page.context.getClientUrl() + "/api/data/v8.2/" + "CalculateRollupField(Target=@p1,FieldName=@p2)?" + "@p1={'@odata.id':'" + EntityName + "(" + recGuid + ")'}&" + "@p2='" + RollUpFieldName + "'", true);
HttpReq.onreadystatechange = function ()
{
if (this.readyState === 4)
{
HttpReq.onreadystatechange = null;
if (this.status === 200)
{
var results = JSON.parse(this.response);
}
else
{
Xrm.Utility.alertDialog(this.statusText);
}
}
};
HttpReq.send(JSON.stringify({}));
}
You can then retrieve the updated value via JS API call and use XRM commands to replace the updated value in the form