I have used the following JavaScript to populate a filed on a parent from based on the summed values of a field on thew child.
The script is working and the field is updating but it is not saving, even if I click the floppy disk "Save" symbol in the bottom right.
Am I missing a final line or something? I had thought that once I had set the value and saved it would persist
Thanks in advance
function calcServicePriceTotal() { if (document.getElementById("Services")) { var grid = document.getElementById("Services").control; var ids = grid.get_allRecordIds() var sum = 0 for (i = 0; i < ids.length; i++) { var cellValue = grid.getCellValue('iss_salesprice', ids[i]); var number = Number(cellValue.replace(/\D/g, '')); number = number/100; sum = sum + number; } Xrm.Page.data.entity.attributes.get("iss_value").setValue(sum); } else { setTimeout("calcServicePriceTotal();", 1500); crmForm.Save(); } }