Create Trigger [ONmove event ] on custom field Text box in Purchase Order Item


Form Name : Purhcase Order Item

I need help on urgent bases, I have 3 Text boxes (Customfield) AAA,BBB,CCC

I want when i enter some value in CCC, when my cursor move to next field , trigger automatically calculate and but value in other 2 fields (AAA,BBB)

Example : suppose i put value CCC = 45, on move trigger fire and put (CCC * 12) value in other fields (AAA,BBB)

This calculation i need on PURCHASE ORDER ITEM Form


frappe.ui.form.on('Purchase Order Item', 'CCC', function(frm, cdt, cdn) {
    var row = locals[cdt][cdn];
    frappe.model.set_value(cdt, cdn, 'AAA', row.CCC*12);
    frappe.model.set_value(cdt, cdn, 'BBB', row.CCC*12);

1 Like

Thanks @nabinhait
working fine, Thanks again for your help