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