It is possible to auto-filter Products that appear in the pop-up search window when linking Products to any module with a product grid, based on values on the record being linked to. 

For example, if you hold a product type custom field on your orders, you can pass the value set on this field into the product popup search to filter the search by products that match that product type. 

The product field to filter by does not need to be one of the fields already on the search screen. 

This is controlled by a setting in Additional settings :

Restrict popup search based on field value on sales module

Type in values in the following format to specify settings for this field:

MODULE|MODULEFIELD|FILTERTYPE|PRODUCTFIELD

MODULE The parent module to pass the value into the search from

MODULEFIELD The field on the parent module to get the value to pass into the search form

FILTERTYPE EQUALS or CONTAINS to specify if the search is an exact match, or a contains search 

PRODUCTFIELD the field to filter against on the product. 

In this example, I have set a condition for the Sales Order module where if the custom field cf_501 matches a value in the Product Category field, then the Product Search will only display Products from that Category:

It is possible to use multiple configurations in on different lines, for e.g. different modules.