# foundsetUpdater on Table?

**URL:** <https://forum.servoy.com/t/foundsetupdater-on-table/11382>\
**Category:** Classic Servoy\
**Created:** [November 10, 2009, 10:09am UTC](https://forum.servoy.com/t/foundsetupdater-on-table/11382 "2009-11-10T10:09:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 10, 2009, 10:09am UTC](https://forum.servoy.com/t/foundsetupdater-on-table/11382/1 "2009-11-10T10:09:28Z")

</div>

Hi Folks - I’m having a challenge with what should be a relatively simple update. I use a foundsetUpdater to set a single column checkbox.

Form A has a table in a tab panel, Form A has a different table connection (non-related), my code runs from a button on Form A:

```auto
function runBetweenFlags()
{
	var startIndex = arguments[0];
	var endIndex = arguments[1];
		controller.setSelectedIndex(1)
	var FsetUpdater = databaseManager.getFoundSetUpdater(forms.zsystem_tci_yearend_table.foundset), vCount=1, vRC;
		
		while( FsetUpdater.next() )
		{
		    vRC = forms.zsystem_tci_yearend_table.foundset.getRecord(vCount);
			if(vCount >= startIndex && vCount <=endIndex)
		    {
			FsetUpdater.setColumn('yearEndSelect',1);
		    }
			vCount++;
		}
		plugins.dialogs.showInfoDialog( 'Flag Setting Complete', 'All flags between your two chosen rows have been checked', 'OK')
		FsetUpdater.performUpdate()
		application.updateUI()
}

```

var FsetUpdater = databaseManager.getFoundSetUpdater(forms.zsystem\_tci\_yearend\_table.foundset) is the table forms foundset.

The code runs correctly but the yearEndSelect column never gets updated to 1???

This has to be something simple and to do with how I’m referencing the yearEndSelect column.

Any feedback would be welcome.

---

<div class="post-metadata">

**Author:** ![Kahuna](https://avatars.discourse-cdn.com/v4/letter/k/8491ac/32.png) [@Kahuna](https://forum.servoy.com/u/Kahuna)\
**Post date:** [November 10, 2009, 1:15pm UTC](https://forum.servoy.com/t/foundsetupdater-on-table/11382/2 "2009-11-10T13:15:28Z")

</div>

Modified my code to this - though I’m still at a loss as to why the above does not run?

```auto
function runBetweenFlags()
{

	var startIndex = arguments[0];
	var endIndex = arguments[1];
	controller.recordIndex = startIndex;
	var count = startIndex
	var RC = null
	var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
	while(fsUpdater.next())
	{
		if(foundset.getSelectedIndex() >= startIndex && foundset.getSelectedIndex() <=endIndex)
		{
			fsUpdater.setColumn('yearendselect',1)
		}
		if(foundset.getSelectedIndex()>endIndex)
		{
			break;
		}
		count++
		foundset.setSelectedIndex(count)
	}
fsUpdater.performUpdate();
plugins.dialogs.showInfoDialog( 'Flag Setting Complete', 'All flags between your two chosen rows have been checked', 'OK')
}

```

(Edited my Buggy Code)
