Child pages
  • JSFoundSetUpdater

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
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


HTML Table
classservoy sSummery
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summery
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#next()
Go to next record in this updater, returns true if successful.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#performUpdate()
Do the actual update in the database, returns true if successful.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#resetIterator()
Start over with this iterator 'next' function (at the foundset selected record).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#setColumn(name, value)
Set the column value to update, returns true if successful.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idnext
classnode
Table Row (tr)
idname
Table Cell (td)
next
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
next
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Go to next record in this updater, returns true if successful.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if proceeded to next record, false otherwise
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
controller.setSelectedIndex(1)
var count = 0
var fsUpdater = databaseManager.getFoundSetUpdater(foundset)
while(fsUpdater.next())
{
	fsUpdater.setColumn('my_flag',count++)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idperformUpdate
classnode
Table Row (tr)
idname
Table Cell (td)
performUpdate
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
performUpdate
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Do the actual update in the database, returns true if successful.
There are 3 types of possible use with the foundset updater
1) update entire foundset, not possible when the table of the foundset has tracking enabled, will fall back to 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)
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succeeded, false if failed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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++)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idresetIterator
classnode
Table Row (tr)
idname
Table Cell (td)
resetIterator
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
resetIterator
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Start over with this iterator 'next' function (at the foundset selected record).
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
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)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idsetColumn
classnode
Table Row (tr)
idname
Table Cell (td)
setColumn
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
setColumn
Span
stylefloat: left;
idiets
(name, value)
Table Row (tr)
iddes
Table Cell (td)
Set the column value to update, returns true if successful.
Table Row (tr)
idprs
Table Cell (td)
Parameters
{String} name – The name of the column to update.
{Object} value – The new value to be stored in the specified column.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – true if succeeded, false if failed.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
//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++)
}
Table Row (tr)
classlastDetailRow
Table Cell (td)