Hi,
I have added child table row dynamically using frappe.model.add_child, after adding if i give for_quantity value in parent table its should get copied to child table.
frappe.ui.form.on(“Job Card”, {
refresh: function(frm,cdt,cdn) {
var row = frappe.model.add_child(cur_frm.doc, “Job Card Time Log”, “time_logs”);
cur_frm.from_time = frappe.datetime.now_datetime();
row.from_time = cur_frm.from_time;
cur_frm.to_time = frappe.datetime.now_datetime();
row.to_time = cur_frm.to_time;
row.completed_qty = cur_frm.doc.completed_qty;
row.completed_qty = cur_frm.for_quantity;
cur_frm.script_manager.trigger(“time_logs”, row.doctype, row.name);
cur_frm.refresh_fields(“time_logs”);
}
});
I gave this script its adding row dynamically but when i give for_quantity its not getting copied to child table field completed_qty
Kindly assist ,i have tried many other possible scripts for the same.
Thanks in advance!