How to fetch item in specific item group

Hi @amal_31845,

Please check the documentation of the Overriding Link Query By Custom Script.

Lots of examples are already available in the forum so please search like frm.set_query

frappe.ui.form.on('DocType', {
    refresh: function(frm) {
        frm.set_query("item_code", function() {
            return {
                "filters": {
                    "item_group": frm.doc.item_group
                }
            };
        });
    },
});

Please set the doctype name and field name.

1 Like