Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Field value not saving

$
0
0

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();
    }
}



Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>