Hey
I am trying to make Item code " Ready Only " in Material Request whenever user save it using Custom script but I unable make it read only. As we have approval workflow and I dnt integrity of item is changed in between approval chain Any help will be great
This my code
frappe.ui.form.on(“Material Request”, {
refresh: function(frm) {
// use the __islocal value of doc, to check if the doc is saved or not
frm.set_df_property(“justification”, “read_only”, frm.doc.__islocal ? 0 : 1);
}
});
frappe.ui.form.on(“Material Request”, {
refresh: function(frm1) {
// use the __islocal value of doc, to check if the doc is saved or not
frm1.set_df_property(“items”, “read_only”, frm1.doc.__islocal ? 0 : 1);
}
});
frappe.ui.form.on(“Material Request Item”, {
refresh: function(frm2) {
// use the __islocal value of doc, to check if the doc is saved or not
frm2.set_df_property(“item_code”, “read_only”, frm2.doc.__islocal === 1);
}
});
frappe.ui.form.on(“Material Request”, {
refresh: function(frm4) {
// use the __islocal value of doc, to check if the doc is saved or not
frm4.set_df_property(“requesting_for”, “read_only”, frm4.doc.__islocal ? 0 : 1);
}
});