Set filter to link based on another field (In a child table)

Hi @Nabyar,

It’s worked properly.

frappe.ui.form.on('Payment Entry', {
    refresh: function (frm){
        frm.set_query("reference_name" ,"references", function (doc, cdt, cdn){
            let row = locals[cdt][cdn];
            return {
                filters: [
                    [row.reference_doctype, 'docstatus', '=', 1],
                    [row.reference_doctype, 'company', '=', frm.doc.company],
                    [row.reference_doctype, 'customer', '=', frm.doc.party_name],
                    [row.reference_doctype, 'outstanding_amount', '>', 0]
                ]
            };
        });
    }
});

Output:

3 Likes