Auto-fill not working when I use filter on Lookup_Selecting

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
pandapipino
User
Posts: 103

Auto-fill not working when I use filter on Lookup_Selecting

Post by pandapipino »

// 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?


Webmaster
User
Posts: 9427

Post by Webmaster »

If you are using it in the Add page, there is no $this->salesid->CurrentValue and your additional filter is invalid.


Post Reply