Lookup filed: Advanced query
Posted: 2020-04-18 19:51
I am using APPGINI 5.82 and applying a default filter to ALL tables using the tablename_init hook file. I incorporated a session variable (defined after a successful login) in the filter and it works just fine (shown):
addFilter(1,'and',2,'equal-to',$_SESSION["COMPANY"]);
I then tried a similar approach for the advanced query box in a Department table lookup field, modifying the default query by adding the condition:
WHERE `department`.`Company` = $_SESSION ["COMPANY"]
The query fails.
(FYI, the query will run properly if condition is modified to WHERE `department`.`Company` = 999 )
Is there a solution to including a variable in a lookup field query?
Thanks
joseph
addFilter(1,'and',2,'equal-to',$_SESSION["COMPANY"]);
I then tried a similar approach for the advanced query box in a Department table lookup field, modifying the default query by adding the condition:
WHERE `department`.`Company` = $_SESSION ["COMPANY"]
The query fails.
(FYI, the query will run properly if condition is modified to WHERE `department`.`Company` = 999 )
Is there a solution to including a variable in a lookup field query?
Thanks
joseph