// Lookup Selecting event
function Lookup_Selecting($fld, &$filter) {
// var_dump($fld->FldName, $fld->LookupFilters, $filter); // Uncomment to view the filter
// Enter your code here
$salesid = $this->salesid->CurrentValue;
$customerid = ew_ExecuteScalar("SELECT customerid FROM sales Where salesidx ='". $salesid ."'");
$customersid = ew_ExecuteScalar("SELECT customername FROM customers Where customersid ='". $customerid ."'");
if ($fld->FldName == "orderid")
ew_AddFilter($filter, "orderfrom = '".$customerid."'"); // Assume the field is of string type
}
That's my lookup_selecting code, but my auto-fill on orderid field is no longer working?