Dear all,
Thanks for your help in advance. I read all the other topic regarding custom script with if conditions but could not make it work for my case.
Problem: in a document (purchase order) I fetch two distinct fields(A & B), from two different sources (A comes from Customer and B comes from shipping address) . But I would like field A to be overwritten with filed B only if B is not empty.
This is what I wrote without success:
frappe.ui.form.on(“purchase order”, {
onload: function(frm) {
if(frm.doc.B!==“”) {
frm.set_value(“A”, “B”);
}
}});
Any help or suggestion is highly appreciated.
Best regards,
Michele