This should be simple but I’m obviously missing the concept totally.
I have: Table A is a library with ta_id, ta_description, ta_type - ta_type can only be 1 of 2 values (text).
Form B has a related tabpanel that shows Table B with tb_id, tb_description.
A Valuelist feeds ta_id and ta_description to Form B / Table B. All works nicely. However I’d like to limit the valuelist to only one of the ta_type values?
I tried creating a global var (gtype) with the value as text, building a relation between the library Table A, with globals.gtype = ta_type and creating the valuelist to use the relationship. However this results in zero data in the valuelist combo.
I’m sure its the way I’m setting the valuelist to use the relationship, I’d appreciate some feedback on the best solution to this challenge.
why don’t you build the valuelist using application.setValueListItems?
we do this almost everywhere, sometimes even based on the context of a record…
Just do a small query like:```
SELECT displayval, returnval FROM table_a WHERE ta_type = ?
Then execute the SQL by loading it as a dataset.
Last step is: ```
application.setValueListItems('vlName', dataset)
You should define the valuelist by entering the name and select custom values but don’t enter anything…
Hope this helps!
Nice - thanks Marc
That fits very nicely with my thought process, as setting the combo rowsurce in SQL would have been my prefered choice in a past life! New fangled Valuelist kinda suggests there is another way to do it (Servoy Style…) but this sort of technique ties the old and new together nicely for me.