Lookup field %ID% not working
Posted: 2023-01-09 07:39
Hi guys,
I have a very frustrating problem. I have this query in a lookup field in the 'cases' table:
The idea here is to populate all records from 'cases' table without the actual record that we are in right now. The problem is that this record still shows up. If I replace %ID% with an actual id like 394 for example it hides it just like it has to be. In the same table I have another calculated field with this code:
And this one calculation is working perfectly fine.
I can't understand why %ID% is not working in the lookup field.
I have a very frustrating problem. I have this query in a lookup field in the 'cases' table:
Code: Select all
SELECT `cases`.`id`, IF(CHAR_LENGTH(`cases`.`title`) || CHAR_LENGTH(`cases`.`id`), CONCAT_WS('', `cases`.`title`, ' - ', `cases`.`id`), '') FROM `cases` LEFT JOIN `problems` as problems1 ON `problems1`.`id`=`cases`.`problem` LEFT JOIN `cases` as cases1 ON `cases1`.`id`=`cases`.`preceeding_case` LEFT JOIN `case_types` as case_types1 ON `case_types1`.`id`=`cases`.`case_type` LEFT JOIN `case_subtypes` as case_subtypes1 ON `case_subtypes1`.`id`=`case_types1`.`case_subtype` LEFT JOIN `organizations` as organizations1 ON `organizations1`.`id`=`cases`.`organization` LEFT JOIN `currencies` as currencies1 ON `currencies1`.`id`=`cases`.`currency` WHERE `cases`.`id` <> '%ID%' ORDER BY `cases`.`id` DESC
Code: Select all
SELECT DATEDIFF(`cases`.`end_date`, `cases`.`date`) FROM `cases` WHERE `id` = '%ID%';
I can't understand why %ID% is not working in the lookup field.