← servoy magazine

[Tip] updating column values fast!

  • Tips

by Harjo Kompagnie
www.directict.nl/

In the beginning of Servoy, when we wanted to update a whole column, the only way to do this was by looping.
Than the servoy team created a great feature: updating a whole column at once!

here are three examples:

//1) update entire foundset
var update = databaseManager.getFoundSetUpdater(foundset)
update.setColumn('company_type',1)
update.performUpdate()
  
//2) update part of foundset, for example the first 4 row (starts with selected row)
var update = databaseManager.getFoundSetUpdater(foundset)
update.setColumn('company_type',new Array(1,2,3,4))
update.performUpdate()
  
//3) update a related foundset
var update = databaseManager.getFoundSetUpdater(company_to_addresses)
update.setColumn('zipcode','7683 CK')
update.performUpdate()

Cheers Harjo