Unable to hide custom field

My usecase :
I have a child table in my doctype, with the field name attachment_details. I want to hide/unhide based on certain conditions, but the below snipped doesn’t work at all. Is there anything I’m doing wrong?

cur_frm.toggle_display("attachment_details", true);
>> undefined

Have a look at this thread:

1 Like

Hi @mr-karan. Also take a look at “depends on” feature of a field.

1 Like

Thanks. I was able to solve it. Here’s the snippet i put in the “Depends On” column

eval:doc.name (replace name with your actual doctype name)

1 Like