foundsetUpdater on Table?

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:

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.

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

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)