Hi
I am trying to load additional custom-fields in each row of the “items” table
on Sales Invoice. The documented triggers work when adding rows manually by
selecting “Add row”. However , these triggers are not fired when using the “Get Items FRom” button which caused the table to be populated by the system.
frappe.ui.form.on('Sales Invoice', {
refresh(frm) {
// your code here
},
items_add: function(frm) {
frappe.show_alert("Table");
}
});
frappe.ui.form.on('Sales Invoice Item', {
items_add: function(frm) {
frappe.show_alert("Table");
},
items_on_form_rendered: function(frm) {
frappe.showa_alert("REndered");
}
});
frappe.ui.form.on('Sales Invoice', {
refresh: function(frm) {
if (frm.doc.items && frm.doc.items.length > 0) {
frm.doc.items.forEach(function(item) {
frappe.show_alert("Table");
});
frm.refresh_field('items'); // Ensure UI updates
}
},
onload_post_render: function(frm) {
frappe.show_alert("Post render");
}
});
Could anyone assist please ?