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;)

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

Refresh the field to see the actual changes:
cur_frm.refresh_field(“fieldname”).

@nishith,

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

e.g.
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)`

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

frm.fields_dict.sales_order_custom_parts.grid.toggle_display(“more”,false)

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?

Regards
Ruchin Sharma