Changing the properties of child table fields using custom script

I am using a custom script for changing the properties of “Purchase Receipt Item”(Child Table) of “Purchase Receipt” (Master Doc). I have used “cur_frm.set_df_property(“field_name” , “hidden”, 0)” but it’s not working for me. Is there any way to do that…?

Please try this logic:

Get and store field instance in field variable
var field = cur_frm.fields_dict[“fieldname”'];

Change the property of field using:
field.df.property_name = value; (for example field.df.read_only=1;)

Properties of field will be depends upon fieldtype on which you want to apply operations.

Refresh the field to see the actual changes:


you can use the toggle_display method to hide or unhide the fields.

for form fields use 
`frm.toggle_display("fieldname", true or false)`

for child table fields use the following syntax
`frm.fields_dict.childtable_field_name.grid.toggle_display("fieldname", true or false)`

I tried the below function but it is giving me an error:


sales_order_custom_parts is the child table fieldname
more is the field of child table sales_order_custom_parts in child table

Any idea?

Ruchin Sharma