Hi all - I'm using a data table to add individual lines with costs associated, and wanted to show users the total sum of the "cost" column within the data table in a separate field ("total cost") after each new row is added to the data table.
Thanks mnikitina -
Can you confirm that I should just put putting the JS in the current form JS area and the fields I would need to replace in your code with mine here would be:
line.Column1 -- replace Column1 with the column to sum values from
fd.field('Total') -- replace Total with the form field to update
I'm also including in quantity, so I've tweaked it a little, but have no coding background so I'm 100% guessing =)
(costEach column multiplied by quantity column within the data table)
For some reason it's not populating anything to the field. Here's what I'm using:
fd.control('DataTable1').$on('change', function(value){
var extendCost = 0;
var totalDataTable = 0;
console.log(value);
value.forEach(function(line){