How to Subtract two fields to display result

Hi @Mohamed2335,

I think not possible in field level.

If parent doctype and please check the syntax.

frappe.ui.form.on('Your DocType', {
	field_1: function(frm) {
		cal(frm);
	},
	field_2: function(frm) {
		cal(frm);
	},
});

function cal(frm) {
    frm.set_value('total_field', frm.doc.field_1 - frm.doc.field_2);
}

Child Table Calculation for check the below reference:

Thank You!

1 Like