For some reason, the code below, is hiding “myfield” instead of setting it read only:
frappe.ui.form.on(“MyDocType”, “refresh”, function(frm) {
// use the __islocal value of doc, to check if the doc is saved or not
frm.set_df_property(“myfield”, “read_only”, 1);
}
Any ideas??