# Dynamic value list based on global variable doesnt change

**URL:** <https://forum.servoy.com/t/dynamic-value-list-based-on-global-variable-doesnt-change/10960>\
**Category:** Classic Servoy\
**Created:** [July 25, 2009, 6:25pm UTC](https://forum.servoy.com/t/dynamic-value-list-based-on-global-variable-doesnt-change/10960 "2009-07-25T18:25:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [July 25, 2009, 6:25pm UTC](https://forum.servoy.com/t/dynamic-value-list-based-on-global-variable-doesnt-change/10960/1 "2009-07-25T18:25:34Z")

</div>

Hi,

I have a value list which is dynamic based on the value of a global variable, which i use to limit the list based on the type of entity.

I have solicitors, referrers and agencies, all in the same table which operates.

My value list works fine the first time you bring up the selection box and enter a ‘type value’ using the said script.

```auto
globals.value_list_filter='Solicitor'
globals.input_temp_int1=0
databaseManager.saveData()
application.showFormInDialog(forms.dialogue_choose_solicitor,-1,-1,-1,-1,'Choose Solicitor',false,true,'choose',true);

```

This correctly brings up the list of only solicitors from the providers table as the value list is based on a limit using the field globals.value\_list\_filter.

When i fire up the same dialogue from another button on the same form, changing the value of globals.value\_list\_filter to ‘Referrer’, then the value list stubbornly stays in its initial form.

```auto
globals.value_list_filter='Referrer'
globals.input_temp_int1=0
databaseManager.saveData()
application.showFormInDialog(forms.dialogue_choose_solicitor,-1,-1,-1,-1,'Choose Referrer',false,true,'choose',true);

```

I am assuming that the first list is kept in memory and the change of global variable is not recalculating the list.

Is there something i can do to force this to happen?

Using 3.5.10

David

---

<div class="post-metadata">

**Author:** ![dpearce](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpearce](https://forum.servoy.com/u/dpearce)\
**Post date:** [July 26, 2009, 9:14am UTC](https://forum.servoy.com/t/dynamic-value-list-based-on-global-variable-doesnt-change/10960/2 "2009-07-26T09:14:57Z")

</div>

In the spirit of answering your own question. I have found a solution.

If i force a found set update before bring up the window with the valuelist based on my choice of type then it works:

```auto
globals.value_list_filter='Solicitor'
globals.input_temp_int1=0
var fsUpdater = databaseManager.getFoundSetUpdater(forms.DEV_oranisations_providers.filtered_solicitor_oranisations_providers_to_providers)
fsUpdater.setColumn('type',globals.value_list_filter)
fsUpdater.performUpdate()

application.showFormInDialog(forms.dialogue_choose_solicitor,-1,-1,-1,-1,'Choose Solicitor',false,true,'choose',true);

```
