Hello all…
I am an ernext user but not a programmer…so literally not understand coding or programming but willing to learn…
So, I created a child table called “Checksheet Proses Incinerator” and in the child table, there is two FLOAT data which called “jml_kemasan” and “jml_limbah” here is the table doctype:
I then created a doctype called “Checksheet Proses Incinerator” which I linked the “Checksheet Proses Incinerator” table onto the doctype. So I created a field called “total_kemasan” and “total_limbah” on my “Checksheet Proses Incinerator” doctype.
here is my doctype:
I would like to summarize the total one or two data (either the “total_kemasan” and “total_limbah”) on my “Checksheet Proses Incinerator” doctype - at the “total_kemasan” or “total_limbah” field… but unfortunately my code didn’t work… is there somebody who could help?
Here is my code:
frappe.ui.form.on("Checksheet Proses Incinerator", "validate", function(frm,doc) {
var total = 0
$.each(frm.doc["jml_kemasan"] || [], function(i, d) {
total += d.total_kemasan
});
frm.set_value('sum_total_kemasan', total);
});
Thank you in advance…