Lookup Filter

If you're a new user of AppGini, feel free to ask general usage questions, or look for answers here.
Post Reply
rprevost
Veteran Member
Posts: 47
Joined: 2018-05-30 22:09

Lookup Filter

Post by rprevost » 2018-07-20 20:58

Hello to you all,
Using 5.72
sorry to bother you with this 'trivial' problem.
I am trying to filter a lookup list.
The filter is on a field named actif in the equipe table.
the field actif is a varchar of length 3
In phpMyAdmin, the field actif has been set to index

PROBLEM : On click over the field in detail view, I get the spinning "gizmo" which runs forever without displaying the list (7 items in the table and 6 should be displayed with the filter)

The SQL is:
-----------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') WHERE `equipe`.`actif` != 'Non' FROM `equipe` ORDER BY 2
------------------
I tried with:
-------------------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') WHERE `equipe`.`actif` = 'Oui' FROM `equipe` ORDER BY 2
------------------
What I am doing wrong here?
Regards

pbottcher
AppGini Super Hero
AppGini Super Hero
Posts: 1635
Joined: 2018-04-01 10:12

Re: Lookup Filter

Post by pbottcher » 2018-07-20 21:24

Hi,

can you run the query in phpMyAdmin and see if the query delivers the correct results?
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.

rprevost
Veteran Member
Posts: 47
Joined: 2018-05-30 22:09

Re: Lookup Filter

Post by rprevost » 2018-07-20 21:28

Sorry, my stupid mistake.
I put the WHERE statement before the FROM statement.
The following works great
-------------------------
SELECT `equipe`.`id`, IF(CHAR_LENGTH(`equipe`.`nom`) || CHAR_LENGTH(`equipe`.`id`), CONCAT_WS('', `equipe`.`nom`, ' / ', `equipe`.`id`), '') FROM `equipe` WHERE `equipe`.`actif` = 'Oui' ORDER BY 2
------------------

Post Reply