DYNAMICS 365 HOW TO FORCE RECALCULATE ROLLUP FIELDS
In this quick Blog post, we will see how to force recalculate Rollup fields in JavaScript and C# using the below functions. Recalculate Rollup field in JavaScript (for account entity) function reCalculateRollupField(entityPluralName, recordGuid, rollupFieldName) { recordGuid = recordGuid.replace("{", "").replace("}", ""); var requestUrl = Xrm.Page.context.getClientUrl() + "/api/data/v9.0/CalculateRollupField(Target=@tid,FieldName=@fn)?@tid={'@odata.id':'" + entityPluralName + "(" + recordGuid + ")'}&@fn='" + rollupFieldName + "'"; var HttpReq = new XMLHttpRequest(); // Double Check the API URL HttpReq.open("GET", requestUrl, true); ...