i haven’t had any luck with the code definitely this line :
frm.doc.denominaciones.forEach(function(d) { total += d.valor; });
isnt updating the value because i tried the same scrip with : for (i = 0; i < [DONOTYETKNOW]; i++) your first postand at least is calculating something. ( the las updated line multiplied by the [DONOTYETKNOW] value.
as for now this is all thats works

for calculating fields within a row.
if i instead use this
frappe.ui.form.on(“Denominaciones”, {
cantidad: function(frm, cdt, cdn) {
var d = locals[cdt][cdn];
var total = 0;
frappe.model.set_value(d.doctype, d.name, “valor”, d.denominacion * d.cantidad);
frm.doc.denominaciones.forEach(function(d) { total += d.valor; });
frm.set_value(‘balance_real’, total);
}
});
theres no calculation at all at row level and total field
also tried this one

from this thread Calculate Total Qty of items table of Sales Invoice - #11 by helenelollipops
And still isnt working, but thank for been patient and pointing me out possible solutions.