Is there code triggered when a doc child table is completed programmatically?
My example is the Get Sales Orders
button on the Production Plan
which fetches the open sales orders using the code below. refresh_field
does not appear to trigger any other user code so that I can fetch the SO PO number to a custom field. I’ve tried various standard form events.
get_sales_orders: function(frm) {
frappe.call({
method: "get_open_sales_orders",
doc: frm.doc,
callback: function(r) {
refresh_field("sales_orders");
}
});
},
I’ve also tried making the custom field a dependant because of the refresh_field code below, but that doesn’t work either.
refresh_field(fname) {
if (this.fields_dict[fname] && this.fields_dict[fname].refresh) {
this.fields_dict[fname].refresh();
this.layout.refresh_dependency();
this.layout.refresh_sections();
}
}