How to calculate two fields in form in Realtime

i want to calculate two fields of my custom form i need to add EMD and SD to get the total can anyone help me with it

You have to create a server side script.

You can use client script for this.
Refer the below code and replace the field_names(emd_field_name, sd_field_name & total_field_name) with the field names you have defined in your doctype.

frappe.ui.form.on("Tender Planning", {
	emd_field_name(frm) {
		frm.doc.total_field_name = frm.doc.emd_field_name + frm.doc.sd_field_name;
	},
	sd_field_name(frm) {
		frm.doc.total_field_name = frm.doc.emd_field_name + frm.doc.sd_field_name;
	}
});

Thanks Sir It’s Working

1 Like