Child pages
  • JSRecord

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 sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
ServoyException
Table Cell (td)
#exception
Returns last occurred exception on this record (or null).
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSFoundset
Table Cell (td)
#foundset
Returns parent foundset of the record.

HTML Table
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
#getChangedData()
Returns a JSDataSet with outstanding (not saved) changed data of this record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
#getDataSource()
Returns the records datasource string.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
#getPKs()
Returns an array with the primary key values of the record.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
#isEditing()
Returns true or false if the record is being edited or not.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#rollbackChanges()
If this record exists in underlying datasource it will do a re-query to fetch the latest data from the datasource.

HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Property Details
Table Body (tbody)
idexception
classnode
Table Row (tr)
idname
Table Cell (td)
exception
Table Row (tr)
iddes
Table Cell (td)
Returns last occurred exception on this record (or null).
Table Row (tr)
idret
Table Cell (td)
Returns
ServoyException – The occurred exception.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var exception = record.exception;
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idfoundset
classnode
Table Row (tr)
idname
Table Cell (td)
foundset
Table Row (tr)
iddes
Table Cell (td)
Returns parent foundset of the record.
Table Row (tr)
idret
Table Cell (td)
Returns
JSFoundset – The parent foundset of the record.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var parent = record.foundset;
Table Row (tr)
classlastDetailRow
Table Cell (td)


HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idgetChangedData
classnode
Table Row (tr)
idname
Table Cell (td)
getChangedData
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
JSDataSet
Span
stylefloat: left; font-weight: bold;
idiets
getChangedData
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)

Returns a JSDataSet with outstanding (not saved) changed data of this record.
column1 is the column name, colum2 is the old data and column3 is the new data.

NOTE: To return an array of records with outstanding changed data, see the function databaseManager.getEditedRecords().

Table Row (tr)
idret
Table Cell (td)
Returns
JSDataSet – a JSDataSet with the changed data of this record.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var dataset = record.getChangedData()
for( var i = 1 ; i <= dataset.getMaxRowIndex() ; i++ )
{
	application.output(dataset.getValue(i,1) +' '+ dataset.getValue(i,2) +' '+ dataset.getValue(i,3));
}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetDataSource
classnode
Table Row (tr)
idname
Table Cell (td)
getDataSource
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
String
Span
stylefloat: left; font-weight: bold;
idiets
getDataSource
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns the records datasource string.
Table Row (tr)
idret
Table Cell (td)
Returns
String – The datasource string of this record.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var ds = record.getDataSource();
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetPKs
classnode
Table Row (tr)
idname
Table Cell (td)
getPKs
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Object[]
Span
stylefloat: left; font-weight: bold;
idiets
getPKs
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns an array with the primary key values of the record.
Table Row (tr)
idret
Table Cell (td)
Returns
Object[] – an Array with the pk values.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var pks = foundset.getSelectedRecord().getPKs() // also foundset.getRecord can be used
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idisEditing
classnode
Table Row (tr)
idname
Table Cell (td)
isEditing
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
Boolean
Span
stylefloat: left; font-weight: bold;
idiets
isEditing
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
Returns true or false if the record is being edited or not.
Table Row (tr)
idret
Table Cell (td)
Returns
Boolean – a boolean when in edit.
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var isEditing = foundset.getSelectedRecord().isEditing() // also foundset.getRecord can be used
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idrollbackChanges
classnode
Table Row (tr)
idname
Table Cell (td)
rollbackChanges
Table Row (tr)
idsig
Table Cell (td)
Span
stylefloat: left; margin-right: 5px;
void
Span
stylefloat: left; font-weight: bold;
idiets
rollbackChanges
Span
stylefloat: left;
idiets
()
Table Row (tr)
iddes
Table Cell (td)
If this record exists in underlying datasource it will do a re-query to fetch the latest data from the datasource.
NOTE: If you use transactions then it will be the data of your last update of this record in the transaction,
not the latest committed data of that record in the datasource.
Table Row (tr)
idret
Table Cell (td)
Returns
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript
var record= forms.customer.foundset.getSelectedRecord();
record.rollbackChanges();
Table Row (tr)
classlastDetailRow
Table Cell (td)