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.Returns the validation object if there where validation failures for this record

...

padding0px
width80px

...

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

...

Table Cell (td)
JSDataSet

...

Table Cell (td)
String

...

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

...

...

Table Cell (td)
void

...

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

...

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

...

servoy sDetail2Property Detailsexceptionname

exception

tr

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

Returns


class

sIndentServoyException -

JSFoundSet - The occurred exception.clients

property

class
Colgroup Tag
Column
padding0px
width100%
Table Row (tr)
style2100%height:30px;
Table Head (th)
colspan1
Table Body (tbody)
idid
Table Row (tr)
Table Cell (td)
id
Table Cell (td)
Div
classid
Table Row (tr)
Div
Div
classsIndent
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
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
id

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

Table Row (tr)

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var parent = record.foundset;
Table Row (tr)
classlastDetailRow
Table Cell (td)

...

idfunction
classservoy sDetail

...

padding0px
width100%
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details

...

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

...

idret

...

classsIndent

...

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

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

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

...

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

...

classlastDetailRow

...

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.

...

idret

...

classsIndent

...

Sample

...

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

...

sIdentjavascriptlastDetailRowgetDataSourcename

getDataSource()

dessIndent
Returns the records datasource string.
ret

Returns

sIndent The datasource string of this record.
clients

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

...

Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an array with the primary key values of the record.

...

idret

...

classsIndent

...

Sample

...

classsIndent

...

Code Block
languagejavascript
var ds = record.getDataSource();

...

classlastDetailRow

...

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

...

classsIndent

...

sIdentjavascriptlastDetailRowgetPKsname

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

...

classlastDetailRow

...

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.

...

idret

...

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

...

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

...

classsIndent

...

Sample

...

classsIndent

...

Code Block
languagejavascript
var hasChanged = record.hasChangedData();

...

classlastDetailRow

...

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

...

classlastDetailRow

...

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.

...

idret

...

sIdentjavascriptlastDetailRowisEditingname

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

...

Supported Clients

sIndentSmartClient,WebClient,NGClient,MobileClient
sam

...

classlastDetailRow

...

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

...

classlastDetailRow

...

Sample

...

classsIndent

...

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