# Using FoundSetUpdater with multiselect

**URL:** <https://forum.servoy.com/t/using-foundsetupdater-with-multiselect/16594>\
**Category:** Classic Servoy\
**Created:** [October 4, 2012, 3:09pm UTC](https://forum.servoy.com/t/using-foundsetupdater-with-multiselect/16594 "2012-10-04T15:09:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RonG](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RonG](https://forum.servoy.com/u/RonG)\
**Post date:** [October 4, 2012, 3:09pm UTC](https://forum.servoy.com/t/using-foundsetupdater-with-multiselect/16594/1 "2012-10-04T15:09:10Z")

</div>

Good day, everyone,

I have a list of items in a form. Some of the fields are updateable. The foundset for the form is set to multiselect.

I would like for the user to be able select some items on the form, update a field on one of the records, and be able to tell Servoy to update the rest of the selected records for me.

From my reading of getFoundsetUpdater, it seems that I have 3 options…

1. update all of the records in the foundset
2. update a portion of the foundset, say 5 records starting from the selected record
3. “safely” loop through the foundset starting with the selected record.

Now, I can use something like getSelectedRecords to “grab” the records that I want to update. So, is that telling me that the correct solution is option 3, where I would use getSelectedRecords to put the records, say, into an array, and then loop through the array to do the updates, finishing with a fsupdater.performUpdate() sort of thing?

Is there a “best practice” for something like this?

As always, any guidance you might provide is greatly appreciated.

Thanks and have a good day.

Ron

---

<div class="post-metadata">

**Author:** ![matthewbrice](https://avatars.discourse-cdn.com/v4/letter/m/fbc32d/32.png) [@matthewbrice](https://forum.servoy.com/u/matthewbrice)\
**Post date:** [October 4, 2012, 5:30pm UTC](https://forum.servoy.com/t/using-foundsetupdater-with-multiselect/16594/2 "2012-10-04T17:30:11Z")

</div>

Out of curiosity, how can the user multi-select records, then gain focus on one particular field of a record and enter a value while maintaining the multi-select?

I would think that you would “lose” the multi-select once a particular field gains focus.(?)

---

<div class="post-metadata">

**Author:** ![RonG](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RonG](https://forum.servoy.com/u/RonG)\
**Post date:** [October 4, 2012, 6:37pm UTC](https://forum.servoy.com/t/using-foundsetupdater-with-multiselect/16594/3 "2012-10-04T18:37:16Z")

</div>

Hi Matt,

Yes, you’re right about that. The actual order is more like…

1. The user updates a field on a record of their choice. Let’s say it’s one of 10 records that they want to update from a list of 50.
2. They user then does their multiselect of the 10 records.
3. They right-click on the field that they updated, which pops up a popupmenu that lets them select an option for “update these records to have this value”. In my tests so far, the multiselect does continue to “hold” during the right-click.

What I’m trying to figure out now is the correct/best way to accomplish the group update. And, trying to turn that logic into a global function that I can attach to any field I’d like to have work this way. I know that I can pass the form name with controller.getName(), but I haven’t seen the way yet to get the name of the field I’m on in a generic manner. I can pass the name directly through a parameter if I have to, but it’d be slicker if I could just have the function figure that out for itself. I’ve been working with Servoy for a little while now, so, while I’m getting better, I still miss obvious things. I know where to look for the most part; it’s just that there’s _so much_ to look at. So, I come here and ask, hoping that some more knowledgeable person will show mercy on my poor little Servoy soul and help me out ![:-)]( "Smile").

Ron
