Filter for table multiselect

Hi is there any custom script to filter the table multi select
Case: we want to make a filtered drop down for the product type, item class will only show based on product based on product type as their parent.

1 Like

hello, Can anyone help me with this please?

Did you find any solution?

You can try this

    	frm.set_query(your_multiselect_field, function(doc, cdt, cdn) {
            var d = locals[cdt][cdn];
            return {
                "filters": [
                    [your_doctype_link_option_in_childtable, field_doctype_to_filter, "=", value_to_filter]
                ]
            };
        });
2 Likes

More info here: Overriding Link Query By Custom Script

@jbtruffault @Ignite @jo_jo @daeng_agiel
custom_alternative_workstations = fieldname of table multiselect type field
This field is link with child table “Alternative Workstations”
this child table has one link field Workstation (Link with Workstation)

workstation_name field is available in Workstation doctype

cur_frm.fields_dict.custom_alternative_workstations.get_query = function (doc) {
return {
filters: {
workstation_name: [‘!=’, frm.doc.workstation],
},
}
}

1 Like