Link only active employees in custom doctype

Hi @Rahul_Singh,

Please apply the clinet script for it.

frappe.ui.form.on("ESIC Monthly Contribution Form", {
    refresh:function(frm) {
        frm.set_query("employee", function() {
            return {
                "filters": {
                    'status': "Active"
                }
            };
        });
    }
});

Please check/set the doctype and field name in the script.

Reference: Overriding Link Query
I hope this helps.

Thank You!

2 Likes