Add row to table automatically

hi…
i just want to add the row automatically in child table, while i create a new document.

for example if i create a new document in job card, the time logs table row will not created automatically.

Thanks in advance

Hi Revathi,
You can try following on your doctype’s .js file.
For e.g. on journal entry your child table is journal entry account.

var row = frappe.model.add_child(cur_frm.doc, "Journal Entry Account", "accounts");
row.account = "abc";
row.party_type = "Employee";
frm.refresh_fields("accounts");
1 Like