refresh(frm) {
frm.add_custom_button('Pay Advance', function() {
frappe.new_doc('Payment Entry', {
'payment_type': 'Internal Transfer',
});
frm.set_query('paid_from', function() {
return {
'filters': {
'doctype':'Accounts Receivable'
}
};
});
});
}
By using this code i want to set a filter on ‘paid_from’ field in the ‘Payment Entry’ doc.What i am doing here is , i have a custom button ‘Pay Advance’ if i click that i will enter in a new ‘Payment Entry’ also set values on some field ,at the same time i want to set a new filter on the existing field ‘paid_from’ , which already have another filter working , but i want to override and set my new filter ,the values from ‘Accounts Receivable’ . ‘Accounts Receivable’ is inside Chart of Accounts.How can i do that ?