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",;
df1.read_only = 1;

Try this to set child field as read only

hiee hafees !!!
but the above code is not working… :frowning:
var df = frappe.meta.get_docfield(“Boq Item”, “item_code”,;
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",; df1.read_only = 1; });

1 Like

Ya its working. Thanks @hendrik_zeta @Hafees_Kazhunkil