frappe.ui.form.on(‘Necesar Materiale’, {
onload: function(frm) {
//This will make sure they are are updated whenever the form reloads
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
cantitate: function(frm) {
//This will make sure the calculation happens whenever cantitate is updated
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
pret_2: function(frm) {
//This will make sure the calculation happens whenever pret is updated
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
});
frappe.ui.form.on(‘Necesar Materiale’, {
onload: function(frm) {
//This will make sure they are are updated whenever the form reloads
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
cantitate: function(frm) {
//This will make sure the calculation happens whenever cantitate is updated
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
pret_2: function(frm) {
//This will make sure the calculation happens whenever pret is updated
frm.set_value(“total”, cur_frm.doc.cantitate * cur_frm.doc.pret_2);
},
frappe.ui.form.on(‘Necesar Materiale’, {
onload: function(frm) {
//This will make sure they are are updated whenever the form reloads
frm.set_value(“total”, frm.doc.cantitate * frm.doc.pret_2);
frm.refresh_field("total");
},
cantitate: function(frm) {
//This will make sure the calculation happens whenever cantitate is updated
frm.set_value(“total”, frm.doc.cantitate * frm.doc.pret_2);
frm.refresh_field("total");
},
pret_2: function(frm) {
//This will make sure the calculation happens whenever pret is updated
frm.set_value(“total”, frm.doc.cantitate * frm.doc.pret_2);
frm.refresh_field("total");
}
});
I think you wrote a trigger on your main form. So you need to write it on you Child Table trigger instead of main form.
Please refer my previous reply…