ERPNext Foundation ERPNext Cloud Chat Blog Discuss Frappé* Donate

Set field as read-only when editing record


#1

Hi!

I’m new to ERPNext and I would like to know if it is possible to set a field as read-only during editing only.

Example:

Raised by field should be editable when I create an Issue. But must be read-only once I try to edit the record.


#2

Dear Chris,

Can you please tell us What is the Status of the Document when you try to edit the field?
Is the Document is Draft state or the Submitted state?
You can see this on the Top left corner.

regards,
Rushikesh


#3

Status is Active. BTW, I customized the select items for the Status field.


#4

Hii
Yes its possible, you can use
cur_frm.set_df_property("your field name","read_only",1); on validate event of js side.