I used this code for calculation field on doctype
i want to apply this code on child table called Maintenance Schedule Checklist on parent doctype called Maintenance Schedule , the table name in parent doctype called lines
frappe.ui.form.on('Maintenance Schedule Checklist', {
validate: function(frm) {
frm.trigger("estimated_cost_amount")
},
estimated_cost_rate: function(frm) {
frm.trigger("estimated_cost_amount")
},
quantity: function(frm) {
frm.trigger("estimated_cost_amount")
},
estimated_cost_amount:function(frm){
if (frm.doc.quantity && frm.doc.estimated_cost_rate){
frm.set_value('estimated_cost_amount',flt(frm.doc.quantity) * flt(frm.doc.estimated_cost_rate))
}
},