How to calculate number of child table rows based on field

i want to calculate number of child which have In Progress status, This script not working

any one given me corrections in this script

 frappe.ui.form.on('Parent Doctype', {
          refresh(frm) {
                let totalInProgress = frm.doc['Child Table Name'].filter(function(row) 
{
                return row.status === 'In Progress';}).length;
                frm.set_value('Field Name', totalInProgress);
}  

});

Thank You

@nilpatel42 work fine with me . child table name is the field name not the doctype name

1 Like

Now working well :laughing: