I have a Valuelist in a city field on a form that shows a list of all cities that belong to the country of the logged user and works fine.
But I need, when an administrator user is logged in, that the valuelist shows all the cities regardless of the country. I’ve been trying to find how to change the valuelist asigned to that field at run-time but I could not find it.
Any ideas?
I would like to change the name of the current Valuelist for another that show all the cities.
you can set a valuelist “vl_cities” (without settings) by application.setValueListItems() and fill the values by SQL query (filtered for users and no filter for the administrator).
Have a look at the sample in the Servoy developer (move sample…).
Best way is to use the fallback valuelist option. Assuming you just want to see it, and not change it. So you have 1 value list, like you do now showing the cities for that user. Then a second valuelist showing all possible cities. On the first valuelist, set the second valuelist as the fallback. We have a video on ServoyU about this