frappe.ui.form.on(‘Sales Invoice’, {
onload: function(frm) {
// Set the options of custom_status dynamically
frm.fields_dict[‘items’].grid.update_docfield_property(‘custom_status’, ‘options’, [‘Draft’, ‘Submit’, ‘Cancel’, ‘Update’].join(“\n”));
console.log(frm.doc.custom_status);
},
custom_status: function(frm) {
console.log(frm.doc.custom_status); // Logs the selected value from custom_status field
}
});
this code work ok in child table custom_status field and show options but when in table setting to select field for display in table then not working and also not show options.