Child pages
  • JSRecord

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.\\ \\ Enter additional information related to this 'class' inside the \{div} macro with 'id=description'{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}[ServoyException]{td}{td}[#exception] Returns last occurred exception on this record (or null).{td}{tr}{tbody}{tbody}{tr}{td}[JSFoundSet]{td}{td}[#foundset] Returns parent foundset of the record.{td}{tr}{tbody}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[JSDataSet]{td}{td}[#getChangedData]\() Returns a JSDataSet with outstanding (not saved) changed data of this record.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getDataSource]\() Returns the records datasource string.{td}{tr}{tbody}{tbody}{tr}{td}[Object]\[]{td}{td}[#getPKs]\() Returns an array with the primary key values of the record.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#hasChangedData]\() Returns true if the current record has outstanding/changed data.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isEditing]\() Returns true or false if the record is being edited or not.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#isNew]\() Returns true if the current record is a new record or false otherwise.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#revertChanges]\() Reverts the in memory outstanding (not saved) changes of the record.{td}{tr}{tbody}{table}\\ {table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=exception}{tr:id=name}{td}h6.exception{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns last occurred exception on this record (or null).{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[ServoyException] -- The occurred exception.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

GENERATOR.

Div
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary
Table Row (tr)
Table Cell (td)
ServoyException
Table Cell (td)
exception
Returns last occurred exception on this record (or null).
Table Row (tr)
Table Cell (td)
JSFoundSet
Table Cell (td)
foundset
Returns parent foundset of the record.



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
JSDataSet
Table Cell (td)
getChangedData()
Returns a JSDataSet with outstanding (not saved) changed data of this record.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getDataSource()
Returns the records datasource string.
Table Row (tr)
Table Cell (td)
Object[]
Table Cell (td)
getPKs()
Returns an array with the primary key values of the record.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
hasChangedData()
Returns true if the current record has outstanding/changed data.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isEditing()
Returns true or false if the record is being edited or not.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isNew()
Returns true if the current record is a new record or false otherwise.
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
revertChanges()
Reverts the in memory outstanding (not saved) changes of the record.



HTML Table
idproperty
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Details
Table Body (tbody)
idexception
Table Row (tr)
idname
Table Cell (td)

exception

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns last occurred exception on this record (or null).
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
ServoyException - The occurred exception.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var exception = record.exception;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=foundset}{tr:id=name}{td}h6.foundset{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns parent foundset of the record.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSFoundSet] -- The parent foundset of the record.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idfoundset
Table Row (tr)
idname
Table Cell (td)

foundset

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns parent foundset of the record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
JSFoundSet - The parent foundset of the record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var parent = record.foundset;
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getChangedData}{tr:id=name}{td}h6.getChangedData{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[JSDataSet]{span}{span:style=font-weight: bold;}getChangedData{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}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().{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[JSDataSet] -- a JSDataSet with the changed data of this record.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetChangedData
Table Row (tr)
idname
Table Cell (td)

getChangedData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
JSDataSet
Span
stylefont-weight: bold;
getChangedData
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent

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

Div
classsIndent
JSDataSet - a JSDataSet with the changed data of this record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
/** @type {JSDataSet} */
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));
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getDataSource}{tr:id=name}{td}h6.getDataSource{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getDataSource{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns the records datasource string.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- The datasource string of this record.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetDataSource
Table Row (tr)
idname
Table Cell (td)

getDataSource

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getDataSource
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the records datasource string.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String - The datasource string of this record.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var ds = record.getDataSource();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPKs}{tr:id=name}{td}h6.getPKs{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Object]\[]{span}{span:style=font-weight: bold;}getPKs{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns an array with the primary key values of the record.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Object]\[] -- an Array with the pk values.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPKs
Table Row (tr)
idname
Table Cell (td)

getPKs

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Object[]
Span
stylefont-weight: bold;
getPKs
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an array with the primary key values of the record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
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
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=hasChangedData}{tr:id=name}{td}h6.hasChangedData{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}hasChangedData{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns true if the current record has outstanding/changed data.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if the current record has outstanding/changed data.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idhasChangedData
Table Row (tr)
idname
Table Cell (td)

hasChangedData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
hasChangedData
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the current record has outstanding/changed data.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if the current record has outstanding/changed data.
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var hasChanged = record.hasChangedData();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isEditing}{tr:id=name}{td}h6.isEditing{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isEditing{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns true or false if the record is being edited or not.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- a boolean when in edit.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisEditing
Table Row (tr)
idname
Table Cell (td)

isEditing

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isEditing
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true or false if the record is being edited or not.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
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
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isNew}{tr:id=name}{td}h6.isNew{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isNew{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Returns true if the current record is a new record or false otherwise.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean] -- true if the current record is a new record, false otherwise;{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisNew
Table Row (tr)
idname
Table Cell (td)

isNew

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isNew
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if the current record is a new record or false otherwise.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean - true if the current record is a new record, false otherwise;
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var isNew = foundset.getSelectedRecord().isNew();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=revertChanges}{tr:id=name}{td}h6.revertChanges{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}void{span}{span:style=font-weight: bold;}revertChanges{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Reverts the in memory outstanding (not saved) changes of the record.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idrevertChanges
Table Row (tr)
idname
Table Cell (td)

revertChanges

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
void
Span
stylefont-weight: bold;
revertChanges
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Reverts the in memory outstanding (not saved) changes of the record.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var record= forms.customer.foundset.getSelectedRecord();
record.revertChanges();
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)