Wednesday, 12 August 2015

Script to filter address in child table and document

# Script to filter records in child table

cur_frm.set_query("buyer", "documents_required", function(doc) {
            if(doc.customer) return {filters: { 'address_type': 'Buyer', customer: doc.customer } };
        });


#script to filter records in document

cur_frm.set_query('buyer', function (doc) {
    if(doc.customer){
        return {
            filters: {
                'address_type': 'Buyer',
                'customer' : doc.customer
            }
        }
    }
    else {
        return {
        filters: {
                'address_type': 'Empty',
            }
        }
    }
});

No comments:

Post a Comment