When I use this method:
frappe.ui.form.on("Delivery Note Item", "item_code", function(frm, cdt, cdn){
item = locals[cdt][cdn]
msgprint(item.item_code);
msgprint(item.price_list_rate);
cur_frm.refresh_fields();
cur_frm.cscript.recalculate();
msgprint(item.price_list_rate);
});
what I get is the previously selected Delivery Note Item. So this is like before update event.
How can I get the newly selected Delivery Note Item? Suppose I am changing my selection from Item A to Item B, I would like to get Item B, not Item A. The code above gives me Item A. Is there anything like after update event?
Sorry, this question was posted before inside the topic: Populate Custom Field in Item to Delivery Note Item. But I haven’t got an answer. So I am posting it as a new topic.
-nanto