Lookup table limit records on list page

I currently have 35,000 customers on my modal lookup and I wanted to limit the records on my list, to make my website faster and only display the customer on add and edit.

Here’s my attempt to limit my record:

// Lookup Selecting event
function Lookup_Selecting($fld, &$filter) {
	//var_dump($fld->FldName, $fld->LookupFilters, $filter); // Uncomment to view the filter
	// Enter your code here

if (CurrentPageID() == "list") {

if ($fld->FldName == "customerid"){
ew_AddFilter($filter, "customersid = '".$this->customerid->CurrentValue."' LIMIT 1"); // Assume the field is of string type
}

}


}

Your code is unnecessary, in List page, the script always select/lookup one record according to the Customer ID, and it will not do that repeatedly. (Assume you are not using very old versions.)