How to "calculate" the field value in realtime?

Hi @RustemHesenov,

For parent doctype:
Please apply and check it.

frappe.ui.form.on('Parent DocType',  {
    contract_amount: function(frm) {
        frm.set_value("rest_of_amount", frm.doc.contract_amount - frm.doc.paid_amount);
    }
});

frappe.ui.form.on('Parent DocType',  {
    paid_amount: function(frm) {
        frm.set_value("rest_of_amount", frm.doc.contract_amount - frm.doc.paid_amount);
    }
});

For child doctype:
please check it.


Child table column total set in parent field for check it.

Thank You!

1 Like