Add Custom Filters In Advanced Search

Is there any option to add custom filters in the advanced search? I need search fields like the below screen

shot.

I customized the link_selector.js file and I added filters that I need and we can add data columns too New-Sales-Order-1-New-Sales-Order-1

1 Like

Please share some code or details to customize link selector , how we can extend it for different doc types. thanks in advance

In link_selector.js under make method

if (this.doctype == ‘Customer’) {
this.dialog = new frappe.ui.Dialog({
title: __(“Select {0}”, [(this.doctype == ‘[Select]’) ? __(“value”) : __(this.doctype)]),
fields: [

				{
					fieldtype: "Link", fieldname: "sales_person",
					options: 'Sales Partner', label: __("Sales Partner"),
					description: __("Sales Partner%"),
					onchange: (e) => {
						me.start = 0;
						me.search();
					}
				},
				{
					fieldtype: "Column Break"
				},
				{
					fieldtype: "Data", fieldname: "txt", label: __("Customer Name"),
					description: __("Customer Name %"),
					onchange: (e) => {
						me.start = 0;
						me.search();
					},

				},
				{
					fieldtype: "Column Break"
				},
				{
					fieldtype: "Section Break"
				},
				{
					fieldtype: "HTML", fieldname: "results"
				},
				{
					fieldtype: "Button", fieldname: "more", label: __("More"), click: () => {
						me.start += 20;
						me.search();

					}
				}
			],
			primary_action_label: __("Search"),
			primary_action: function () {
				me.start = 0;
				me.search();
			}
		});
	}

Added my custom code for additional filters and you have update link_search method too

1 Like

Thanks for sharing, I need to apply for link fields in child table like quotation Items, Will try to modify and apply.

I have Added this in the code but it is not taking any effect ?

Please share your code