I try to place a code into Lookup Table -> Filter (I wish select data based on data from another table):
The logic I need is something like this but it doesn't work because it selects more than one record: "product_id
= '" .ew_ExecuteScalar("select product_id from product_description where product_id in (select product_id from product where status = 1) "). "' "
This one for instance is working: "product_id
= '" .ew_ExecuteScalar("select product_id from product_description where product_id = '85' "). "'"
I have read the manual that I would probably need a MyLookupFilterFunction() but I have no idea what kind of script and where to put it to make it working (never did):
I think I need something like I use in Recordset_Selecting but as I said - no idea how to...:
$lookuptblfilter = "product_id
= '" .
$rs = ew_Execute("select product_id from product_description where product_id in (select product_id from product where status = 1) ");
if ($rs && $rs->RecordCount() > 0) {
$sFilter = "";
while (!$rs->EOF) {
$sFilter .= " To
= '".$rs->fields("product_id")."' OR";
$rs->MoveNext();
}
$sFilter = rtrim($sFilter, "OR");
ew_AddFilter($filter, $sFilter);
$rs->Close();
}
Please advice.