Hello,
I want to update one column in my memory foundset without updating the whole foundset.
Is this possible?
Kind regards.
for (i = 1; i <= fs.getSize(); i++) {
rRec = fs.getRecord(i);
rRec.yourFieldName = "yourNewValue";
}
plugins.rawSQL.executeSQL(scopes.utils.DB.SERVER, null, sSQL);
var updater = databaseManager.getFoundSetUpdater(foundsetYouWantToUpdate)
updater.setColumn("columnName","valueYouWantToInser")
updater.performUpdate()
Bernd.N wrote:Ok, in that case you would have a specific IF-condition that you use inside the loop.
Only when that IF is true, a record of the foundset will get changed.
But you would loop through the complete foundset to inspect all records.
fs.addFoundSetFilterParam('print_or_email', '=', 0, 'filterPrintOrEmail');
fs.loadAllRecords();
marco.rossi wrote:Dear jeffrey,
Have you already tried with the foundsetUpdater?
It's very fast. Y
You can use it as follow:
- Code: Select all
var updater = databaseManager.getFoundSetUpdater(foundsetYouWantToUpdate)
updater.setColumn("columnName","valueYouWantToInser")
updater.performUpdate()
I haven't used it to update a foundset not linked to any table but it should work anyway.
Regards
Marco
http://www.dotzlaw.com/tutorials/servoy-tutorials/servoy-tutorial-optimizing-code-performance/
Users browsing this forum: No registered users and 10 guests