jroyDC
November 23, 2023, 12:32am
1
Trying to add a filter to a custom field to fetch the contacts from within the quotation doc type.
My linked field works but displays all contacts not just the contacts from the company in the quoatation.
Using the example and instructions in the link below, but I do not have a filter button on my custome form control.
https://docs.erpnext.com/docs/user/manual/en/creating-custom-link-field#adding-filters-to-link-field
Any suggestions would be highly appreciated.
Running ErpNext v15
Hosted on Frappe Cloud
Regards Jack
kittiu
February 1, 2024, 4:26pm
2
Yes, me either looking for this feature in version 15. Couldn’t find it.
The filter should only be available in version 15 of ERPNext.
For other versions frm.set_query is the way to go.
Overriding Link Query By Custom Script .
jroyDC
February 1, 2024, 5:05pm
4
I am running V15 and do not see this feature.
I’ve set a filter using the set query instead.
jroyDC
March 9, 2024, 11:23am
5
I used the following code instead
frappe.ui.form.on(“Customer”, {
refresh: function(frm) {
frm.set_query(“custom_customer_billing_address”, function() {
return {
filters: [
[“Dynamic Link”,“link_doctype”, “=”, “Customer”],
[“Dynamic Link”,“link_name”, “=”, frm.doc.customer_name],
[“Dynamic Link”,“link_is_billing_contact”, “=”, “-1”]
]
};
});
}
});
NCP
March 14, 2024, 5:26am
6
Hii @kittiu , @Void_Moon and @Void_Moon ,
Filter feature is not available in version 15 yet. It’s available on the develop branch.
Please check it.
Also, I updated the documentation.
Thank You!
1 Like