Filter for a QuickSearch query

I made a BAQ query and want to use it for quick search. The problem is that the query must return data according to the parameters set in the form from which it is invoked. For example, in the sales order window, by selecting a customer, clicking ShipTo and selecting my query, BAQ should only display delivery points for one customer. How to build such a filter for a QuickSearch query?