Multiple triggers on same doctype

here is my code

frappe.ui.form.on(“Sprint Task”, “expected_time”, function(frm, cdt, cdn) {
console.log(frm.doc.tasks)
var hrs = frm.doc.tasks
var total = 0

for(var i in hrs) {
total = total + parseInt(hrs[i].expected_time);
}
alert(total);
cur_frm.set_value(“total_time”,total)
});

i want to trigger this code on onload and refresh also how is it possible

1 Like