Hide Child table field based on check box in the parent doc

How to Hide Child table field based on check box in the parent doc

you can mentioned depends on value in that table field of parent doc
like eval:doc.field_name==1

if checkbx is checked then the child table will display and vice-versa

Thanks for your reply.
I tried this it worked for the main doc, but did not work for th child table.
The parent dotype is: Purchase Order
The child table is : Items
the field I want to hide is : _value
I added a check box in the parent docktype : is_contract

May you write the exact eval expression that I have to add to the “depends on” box for the the field _value.

I think I am missing somthing in the syntax :slight_smile:

the syntax is like eval:doc.field_name==1
and you have to mentioned child doc name in Option.


Thanks for your reply.
Iwill test it and revert back

I added :

Purchase Order Item

in Options


eval:doc.is_contract == 1

in Depends On

and it is still not working

I noticed something:
It works when I write:

eval:parent.is_contract == 1

in the the depend on and nothing in the options.

But this works only when I open the tabel row for editing.

the column is not hiden in the table view

any help please::slight_smile:

what is the syntax for


To toggle the “in list view” property

hyy did You Find Any Solution

Apply this Custom script for that

frappe.ui.form.on(‘Parent Doctype’, {
check_box: function(frm) {
frm.toggle_display(‘child_table_field’, frm.doc.check_box);

In Python

def update_child_table(doc, method):
if doc.check_box:
for row in doc.child_table:
row.hidden_field = 1
for row in doc.child_table:
row.hidden_field = 0