{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Boolean]{td}{td}[#next]\()
Go to next record in this updater, returns true if successful.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#performUpdate]\()
Do the actual update in the database, returns true if successful.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#resetIterator]\()
Start over with this iterator 'next' function (at the foundset selected record).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#setColumn]\(name, value)
Set the column value to update, returns true if successful.{td}{tr}{tbody}{table}\\
{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=AF90679B-A9B9-4552-B924-6D78DCA1E90E}{tr:id=name}{td}h6.next{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}next{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_des|text=|trigger=button}{sub-section}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_des|trigger=none|class=sIndent}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Methods SummaryGo to next record in this updater, returns true if successful.Do the actual update in the database, returns true if successful.voidStart over with this iterator 'next' function (at the foundset selected record).Set the column value to update, returns true if successful.functionservoy sDetail2100%height:30px2Methods Detailsnextname
next()
dessIndent
Go to next record in this updater, returns true if successful.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_ret|text=|trigger=button}{sub-section}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_ret|trigger=none|class=sIndent}[Boolean] -- true if proceeded to next record, false otherwise{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_see|text=|trigger=button}{sub-section}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_see|text=|trigger=button}{sub-section}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_sam|text=|trigger=button}{sub-section}{sub-section:AF90679B-A9B9-4552-B924-6D78DCA1E90E_sam|class=sIndent|trigger=none}{code:language=javascript}
controller.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
fsUpdater.setColumn('my_flag',count++)
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=265F6D6E-EC6A-4652-9052-99FD54CA56D6}{tr:id=name}{td}h6.performUpdate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}performUpdate{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_des|text=|trigger=button}{sub-section}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_des|trigger=none|class=sIndent}
NOTE: this method doesn't take into account deletes and inserts that may happen at same time. For more reliable iterator see foundset.forEach
ret
Returns
sIndent true if proceeded to next record, false otherwiseclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowperformUpdatename
performUpdate()
dessIndent
Do the actual update in the database, returns true if successful. It will first try to save all editing records (from all foundsets), if cannot save will return false before doing the update.
There are 3 types of possible use with the foundset updater
1) update entire foundset
,
by a single sql statement; that is not possible when the table of the foundset has tracking enabled
,
then it will loop
fall
over
back
the
to
whole
3.
2) update part of foundset, for example the first 4 row (starts with selected row)
3) safely loop through foundset (starts with selected row){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_ret|text=|trigger=button}{sub-section}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, false if failed.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_see|text=|trigger=button}{sub-section}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_see|text=|trigger=button}{sub-section}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_sam|text=|trigger=button}{sub-section}{sub-section:265F6D6E-EC6A-4652-9052-99FD54CA56D6_sam|class=sIndent|trigger=none}{code:language=javascript}
//1) update entire foundset
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
fsUpdater.setColumn('customer_type',1)
fsUpdater.setColumn('my_flag',0)
fsUpdater.performUpdate()
//
foundset.
When a single sql statement is done, modification columns will not be updated and associated Table Events won't be triggered, because it does the update directly in the database, without getting the records.
NOTE: this mode will refresh all foundsets based on same datasource
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.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
fsUpdater.setColumn('my_flag',count++)
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BA850C2C-F2B9-4CD0-A629-625ACCF45CB3}{tr:id=name}{td}h6.resetIterator{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}void{span}{span:id=iets|style=float: left; font-weight: bold;}resetIterator{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_des|text=|trigger=button}{sub-section}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_des|trigger=none|class=sIndent}Start over with this iterator 'next' function (at the foundset selected record).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_ret|text=|trigger=button}{sub-section}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_ret|trigger=none|class=sIndent}void{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_see|text=|trigger=button}{sub-section}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_see|text=|trigger=button}{sub-section}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_sam|text=|trigger=button}{sub-section}{sub-section:BA850C2C-F2B9-4CD0-A629-625ACCF45CB3_sam|class=sIndent|trigger=none}{code:language=javascript}
controller.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
fsUpdater.setColumn('my_flag',++count)
}
fsUpdater.resetIterator()
while(fsUpdater.next())
{
fsUpdater.setColumn('max_flag',count)
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=6A10080C-191B-4DEB-A4F0-1699E24A8809}{tr:id=name}{td}h6.setColumn{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}setColumn{span}{span:id=iets|style=float: left;}\(name, value){span}{td}{tr}{tr:id=des}{td}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_des|text=|trigger=button}{sub-section}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_des|trigger=none|class=sIndent}
after the perform update call there are no records in edit mode, that where not already in edit mode, because all of them are saved directly to the database,
or in mode 1 the records are not touched at all and the database is updated directly.
ret
Returns
sIndent true if succeeded, false if failed.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowresetIteratorname
resetIterator()
dessIndent
Start over with this iterator 'next' function (at the foundset selected record).
clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetColumnname
setColumn(name, value)
dessIndent
Set the column value to update, returns true if successful.
{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_prs|trigger=none}name -- The name of the column to update.
value -- The new value to be stored in the specified column.
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_ret|text=|trigger=button}{sub-section}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_ret|trigger=none|class=sIndent}[Boolean] -- true if succeeded, false if failed.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_see|text=|trigger=button}{sub-section}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_see|text=|trigger=button}{sub-section}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_sam|text=|trigger=button}{sub-section}{sub-section:6A10080C-191B-4DEB-A4F0-1699E24A8809_sam|class=sIndent|trigger=none}{code:language=javascript}
//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.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
fsUpdater.setColumn('my_flag',count++)
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}prs
Parameters
sIndentnameThe name of the column to update.valueThe new value (can be an array with data for x number of rows) to be stored in the specified column.ret
Returns
sIndent true if succeeded, false if failed.clients