Hi Guys , i have a problem to update the values in child table.
Timesheet function have child table called “time logs” . In this child table there is a field “hours” that I want to be calculated from custom fields that are also located in child table.
For eample : if I am filling out timesheet i put there some timesheet details rows to mark up hours on the projects.
I tried every script example but it’s not working even with some simples one.
// make a field read-only after saving
frappe.ui.form.on("Timesheet Detail", {
refresh: function(frm) {
//all of these fields are on Timesheet Detail level (in child table time_logs)
var total_hours = frm.doc.mon + frm.doc.tue + frm.doc.wed ....
frm.set_df_property("hours", total_hours);
}
});
is this correct approach ? or i need to somehow use the parent doctype ?
Thank you very much for advices, i am desperate.
Regards,
Juraj