Child pages
  • JSRecord

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
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'
Divcache
styleindexdisplay:none

...

iddescription

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Property Summary

...

Table Cell (td)
ServoyException

...

Table Cell (td)
JSFoundSet

...

true
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientsWordListMobileClient

servoy sSummary12%30%58%height: 30px;3Property SummaryReturns last occurred exception on this record (or null).

...

Returns parent foundset of the record.

...

padding0px
width80px

...

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary

...

Table Cell (td)
JSDataSet

...

Table Cell (td)
String

...

Returns the validation object if there where validation failures for this record Can be set to null again if you checked the problems, will also be set to null when a save was successful.

servoy sSummary12%30%58%height: 30px;3Methods SummaryCreates and returns a new validation object for this record, which allows for markers to be used outside the validation flow.Returns a JSDataSet with outstanding (not saved) changed data of this record.

...

Returns the records datasource string.

...

Table Cell (td)
Object[]

...

Returns an array with the primary key values of the record.

...

Table Cell (td)
Boolean

...

Returns true if the current record has outstanding/changed data.

...

Table Cell (td)
Boolean

...

Returns true or false if the record is being edited or not.

...

Table Cell (td)
Boolean

...

Returns true if the current record is a new record or false otherwise

...

Table Cell (td)
void

...

.Returns true or false if the related foundset is already loaded.voidReverts the in memory outstanding (not saved) changes of the record.

...

...

property

...

servoy sDetail

...

padding0px
width100%

...

2100%height:30px

...

colspan1

...

2Property Details

...

exception

...

name

...

exception

...

des

...

sIndent
Returns last occurred exception on this record (or null).

...

ret

...

Returns

...

sIndent

...

classsIndent

...

The occurred exception.clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var exception = record.exception;

...

classlastDetailRow

...

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

...

idret

...

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
foundsetname

foundset

dessIndent
Returns parent foundset of the record.
ret

Returns

sIndent The parent foundset of the record.
clients

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

...

classlastDetailRow

...

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
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

Sample

Div
classsIndent
Code Block
languagejavascript

var parent = record.foundset;
sIdentjavascriptlastDetailRowrecordMarkersname

recordMarkers

dessIndent
Returns the validation object if there where validation failures for this record
Can be set to null again if you checked the problems, will also be set to null when a save was successful.
ret

Returns

sIndent The last validation object if the record was not validated.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

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
Stringfunctionservoy sDetail2100%height:30px2Methods DetailscreateMarkersname

createMarkers()

dessIndent
Creates and returns a new validation object for this record, which allows for markers to be used outside the validation flow.
Will overwrite the current markers if present.
Can be set to null again if you checked the problems, will also be set to null when a save was successful.
ret

Returns

sIndent A new validation object.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getChangedDataname

getChangedData()

dessIndent
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().
ret

Returns

sIndent a JSDataSet with the changed data of this record.
clients

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));
}
id

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getDataSourcename

getDataSource()

dessIndent
Returns the records datasource string.
ret

Returns

sIndent The datasource string of this record.
clients

Table Row (tr)

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Table Cell (td) Table Row (tr)

idret
Table Cell (td)Returns
Div
classsIndent
Object[] –

Sample

Div
classsIndent
Code Block
languagejavascript

var ds = record.getDataSource();
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 Cell (td)Returns
Div
classsIndent
BooleansIdentjavascriptlastDetailRowgetPKsname

getPKs()

dessIndent
Returns an array with the primary key values of the record.
ret

Returns

sIndent an Array with the pk values.
clients

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)
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

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
hasChangedDataname

hasChangedData()

dessIndent
Returns true if the current record has outstanding/changed data.
ret

Returns

sIndent true if the current record has outstanding/changed data.
clients

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var hasChanged = record.hasChangedData();
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
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
id

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
isEditingname

isEditing()

dessIndent
Returns true or false if the record is being edited or not.

This will not check if the record doesn't really have any changes, it just returns the edit state.
So this can return true but databaseManager.getEditedRecord() will not return this record because that
call will check if the record has really any changed values compared to the stored database values.
Record can be in edit mode without changes when some field is focused (so edit is started) but no changes are done yet
or when changes were done in such a way that record data is the same as database data.
ret

Returns

sIndent a boolean when in edit.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow
isNewname

isNew()

dessIndent
Returns true if the current record is a new record or false otherwise. New record means not saved to database.
ret

Returns

sIndent true if the current record is a new record, false otherwise;
clients

Table Row (tr)

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Table Cell (td)

Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

var record= forms.customer.foundset.getSelectedRecord();
record.revertChanges();
Table Row (tr)
classlastDetailRow
td

Sample

Div
classsIndent
Code Block
languagejavascript

var isNew = foundset.getSelectedRecord().isNew();
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
sIdentjavascriptlastDetailRowisRelatedFoundSetLoadedname

isRelatedFoundSetLoaded(relationName)

dessIndent
Returns true or false if the related foundset is already loaded. Will not load the related foundset.
prs

Parameters

sIndentrelationNamename of the relation to check for
ret

Returns

sIndent a boolean when loaded.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
revertChangesname

revertChanges()

dessIndent
Reverts the in memory outstanding (not saved) changes of the record.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Sample

sIdentjavascript
lastDetailRow