Set_query on bulk edit field

How to apply the field value filter when the value is updated using bulk edit.

frappe.ui.form.on("Delivery Note", {
    setup: function(frm) {
        frm.set_query("driver", function() {
            return {
                filters: {
                    status: "Active",
                },
            };
        });
    }
});

this code work on form view, but what about the same filter when value is updated using bulk edit (from List view)

Form client script didn’t work, so you need to apply the logic at the list view level using a list view client script. However, it’s unclear if this is possible because it’s a core feature for every doctype. You might not be able to change it for just one specific case, but you should check the core code of bulk edit to confirm.

You may need to implement your own “Bulk Edit” dialog.

1 Like