Client script on Child table

I have two doctype Parent and child doctype, child doctype is inside parent. in child doctypes there are two fields both are link fields. One feild is team which is linked to GP team and project is linked to GP project. in gp project there is a team feild which is a link field which is linked to GP Team. i want project feild data should be filtered according to team feild in child table. do this from client script
frappe.ui.form.on(‘Timesheet NG’, {
refresh(frm) {
// your code here
},
})

frappe.ui.form.on(‘Timesheet NG Child’, {
team: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];

    if (row.team) {
        frm.set_query('project', cdt, cdn, function() {
            return {
                filters: {
                    team: row.team // Filter projects by the selected team
                }
            };
        });
    }
}

});

@management

frappe.ui.form.on('Timesheet NG Child', {
    team(frm, cdt, cdn) {
        let row = frappe.get_doc(cdt, cdn);
          if (row.team){
              frm.set_query("project", "child_table_fieldname", function (doc, cdt, cdn) {
          return {
            "filters": {
              "team": row.team
            },
          };
        });
        }
    }
})

tried but not working
@bahaou

@management try this :
dont forget to change your doctype and fields with your actual fieldnames .

frappe.ui.form.on('Timesheet NG', {
    onload: function (frm) {
    frm.set_query("project", "timesheet_ng_child", function (doc, cdt, cdn) {
      let row = locals[cdt][cdn];
      return {
        "filters": {
           "team": row.team
        },
      };
    });
  }
})