I am setting up a form in which the user drills down the data to a list of records that all need to hold the same classification.
My question is how do I assign a value to a specified field for all records in a foundset. I know its probably simple like deleting all records in a foundset but I can’t seem to find any info on this(I am still looking).
Have a look at databaseManager setColumn, the following code is what you find moving its’ sample code:
//There are 3 types of possible use with the foundset updater
//1) update entire foundset
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('customer_type',1)
fsUpdater.setColumn('my_flag',0)
fsUpdater.performUpdate()
//2) update part of foundset, for example the first 4 row (starts with selected row)
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('customer_type',new Array(1,2,3,4))
fsUpdater.setColumn('my_flag',new Array(1,0,1,0))
fsUpdater.performUpdate()
//3) safely loop through foundset (starts with selected row)
controller.recordIndex = 1
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
fsUpdater.setColumn('my_flag',count++)
}