Hello all,
Im new to ERPNext and coding, I am trying to achieve a scenario where when in Journal entry, if someone adds a row and the account field in child table is value x for example, the the parent field(user remark) should be set to y value.
Here is the code i tried but is not working properly:
frappe.ui.form.on(‘Journal Entry Account’,‘debit’,function(frm,cdt,cdn){
{
if(frm.doc.account == “Cash-ABC”){
console.log(“test success”);
cur_frm.doc.user_remark = “Test”;
cur_frm.refresh_field(‘user_remark’);
}
else console.log(“fail”);
}
});