Allow select tag to retrieve available values for the field

Post Reply
andonovar
User
Posts: 4

Allow select tag to retrieve available values for the field

Post by andonovar »

To me the most obvious thing I would like to do with a select tag, is have it retrieve the available values for the field.
So if the table was Countries and the field was Country, it could do a "select distinct Country from Countries".
This would then be used when editing the field, or searching.

I thought the "Lookup Table" option was the way to do this.
You can define the current table as the lookup table, and look for distinct values.
However when I did this on a wide-scale, I found horrendous performance.
When I dug deeper, phpmaker was issuing queries of the form
select country from countries where country='China'
select country from countries where country='USA'
i.e. it was issuing queries for every value within the field, which is completely unnecessary.

After an exchange with Support, they told me that this feature was NOT designed for this simple case, it is designed for the more complex case where there is a foreign table, and it is thus retrieving every possible combination of values etc.

Well, I'd love the simple case to be supported. (in a performant way)
i.e. for a select field, let the lookup table be "self" and the field be "self" and give me available values.


Post Reply