Set the field as Read Only after saving

in Sales Person Doctype, I want to Set the Employee field as Read Only after saving for document.

Does anyone have an idea how this can be done?

You need to create a custom script.
And use the cur_frm.set_df_property method which is used to update the display of the field…

frappe.ui.form.on(“MyDocType”, “refresh”, function(frm) {
// use the is_new method of frm, to check if the doc is saved or not
frm.set_df_property(“myfield”, “read_only”, frm.is_new() ? 0 : 1);

Please check Make Read Only After Saving

1 Like