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
}
}
}