Can't get fsUpdater to work as intended

I’m trying to script a method that works similarly to the Replace Contents command in Filemaker - a user clicks in a field and then runs a method to replace all values in that field in the foundset with the value in the current record. The field element name is identified by populating a global field with the onFocusGained action (globals.fieldName). Then a method is run with the following code (from which I borrowed liberally from the sample):

if (globals.fieldName == null)
{
	var thePressedButton = plugins.dialogs.showErrorDialog('Error', 'You must select a field to replace values','OK');
	return;
}
var fieldID = elements[globals.fieldName].getDataProviderID();
var val = controller.getDataProviderValue(fieldID);
var msg = "Are you sure you want to replace the contents of [" + globals.fieldName + "]\nwith the value: '" + val + "' in all " + globals.recordMax + " records of the found set?";
var answer = plugins.dialogs.showQuestionDialog( "Replace Contents",  msg,  'Cancel', 'OK');
if (answer == 'OK')
{
	var fsUpdater = databaseManager.getFoundSetUpdater(foundset);
	fsUpdater.setColumn(fieldID,val);
	fsUpdater.performUpdate();
}

In the example I was testing, I have 17 records in the foundset. All works well with the script and the variables are populated correctly, but when the update occurs, based on the stack trace, only the current record is updated - the other records in the foundset are not touched.

What am I doing wrong? BTW, I’m running 2.2.1 rc3.

are you shure the foundset you want to update is the right one??

In your message you are showing: globals.recordMax ?? but does it correspond to foundset.getSize() of the foundset you are trying to update?

Enrico:

Thanks for the tip - you were correct. The globals.recordMax variable was referring to the correct found set, but it turned out that the method was being called from within a tab panel, which was related to the main form (the one with the found set of 17) by a relation that restricted it to the current record. I didn’t realize this was the problem as the forms all were set up to share the same found set. Now I see the value of unrelated tab panels!