Hi,
We have created a custom field - table (approval_workflow) in Purchase Order. And upon validate, we add_child to the table. However, the added row appears for a short second and disappears.
We are trying to understand the methods in Purchase Order. We do want the method to be at validate. However, is there another method after the Save that refreshes the code? Currently, even after the add_child the table shows no data after Save - the row disappears after appearing for a few seconds. Kindly advice how to add_child to our custom table upon Save at Purchase Order. Thank you.
Following is the add_child method at Custom Script triggered upon validate :
frappe.ui.form.on("Purchase Order", "validate", function(frm, dt, dn) {
frappe.call({
method: "organizational_management.organizational_management.doctype.purchase_order_approval_workflow.purchase_order_approval_workflow.get_items",
args: {
form : cur_frm.doc
},
callback: function(r) {
var e = cur_frm.add_child('**approval_workflow**');
e.action = "Apply";
refresh_field("**approval_workflow**");
}
});
});