How to make a field/row of a child table of a doc read_only

I need to make a field/row of a table read-only.
How can i do that??

var df1 = frappe.meta.get_docfield("Child Table Name","field_name", cur_frm.doc.name);
df1.read_only = 1;

Try this to set child field as read only

@Hafees_Kazhunkil
hiee hafees !!!
but the above code is not working… :frowning:
var df = frappe.meta.get_docfield(“Boq Item”, “item_code”, cur_frm.doc.name);
df.read_only = 1;
this is my code used for my custom module.
can u help me with this…

Try this code:
frappe.ui.form.on("Quotation", "refresh", function(frm) { var df1 = frappe.meta.get_docfield("Quotation Item","item_name", cur_frm.doc.name); df1.read_only = 1; });

1 Like

Ya its working. Thanks @hendrik_zeta @Hafees_Kazhunkil