I want To create new record in other doc type called 'Salary Structure 'based on the doctype called “employee contract” using custom button in" employee contract" doctype ,
I did this in parent doctype but can’t with child table
this the code ,my problem is with in the Doctype contract term that have many rows i want to select some of the row and all Colum field to put in salary child table that on other doctype ,
this code write on employee contract doctype,
data = {
'doctype': 'Salary Structure',
'__newname': cur_frm.doc.party_name,
'employee':cur_frm.doc.employee_name,
'contract_date_start':cur_frm.doc.start_date,
'salary':[]
}
frappe.db.insert(data).then(data => {
console.log("Inserted");
frm.save_or_update();
frappe.msgprint(__("Salary Structure Created"));
})