Apply filters on "Dynamic Link" field

Hi All,

In Journal Entry Account, I’m trying to apply filters on Party(Dynamic Link filed) based on selected Party Type and the filter condition working only for Supplier and Employee doctypes but the filter condition not working for Customer Doctype.

Please find the below code :

cur_frm.fields_dict[‘accounts’].grid.get_field(‘party’).get_query = function(doc, cdt, cdn) {
console.log(“entering logs…”);
if (cur_frm.doc.business_event) {
var be_details = get_business_event_details(cur_frm.doc.business_event);
var party_type = be_details.party_type;
var party_sub_type = be_details.party_sub_type;

    if (party_type == "Customer") {
        return {
            filters: {
                'customer_group': party_sub_type
            }
        }
    } //end of customer party type..


    if (party_type == "Supplier") {
        return {
            filters: {
                'supplier_type': party_sub_type
            }
        }
    } //end of supplier party type..

    if (party_type == "Employee") {
        return {
            filters: {
                'employment_type': party_sub_type
            }
        }
    } //end of employee party type..
}

} // end of set party filter options…

Regards,
Raghu.P