JSRecord
Overview
JSRecord represents one row of a JSFoundset.
Properties Summarized
Type | Name | Summary |
---|---|---|
Returns 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 Can be set to null again if you checked the problems, will also be set to null when a save was successful. |
Methods Summarized
Type | Name | Summary |
---|---|---|
Creates 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. | ||
Returns an array with the primary key values of the record. | ||
Returns true if the current record has outstanding/changed data. | ||
Returns true if the current record is a deleted record or false otherwise. | ||
Returns true or false if the record is being edited or not. | ||
Returns true if the current record is a new record or false otherwise. | ||
Returns true or false if the related foundset is already loaded. | ||
void | Reverts the in memory outstanding (not saved) changes of the record. | |
Saves the in memory outstanding (not saved) changes of the record and stops its editing. |
Properties Detailed
exception
Returns last occurred exception on this record (or null).
Type Exception The occurred exception.
Sample
foundset
Returns parent foundset of the record.
Type JSFoundSet The parent foundset of the record.
Sample
recordMarkers
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.
Type JSRecordMarkers The last validation object if the record was not validated.
Sample
Methods Detailed
createMarkers()
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.
Returns: JSRecordMarkers A new validation object.
Sample
getChangedData()
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().
Returns: JSDataSet a JSDataSet with the changed data of this record.
Sample
getDataSource()
Returns the records datasource string.
Returns: String The datasource string of this record.
Sample
getPKs()
Returns an array with the primary key values of the record.
Returns: Array an Array with the pk values.
Sample
hasChangedData()
Returns true if the current record has outstanding/changed data.
Returns: Boolean true if the current record has outstanding/changed data.
Sample
isDeleted()
Returns true if the current record is a deleted record or false otherwise. The deletion has not been done in the database itself.
Returns: Boolean true if the current record is a deleted record, false otherwise;
Sample
isEditing()
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.
Returns: Boolean a boolean when in edit.
Sample
isNew()
Returns true if the current record is a new record or false otherwise. New record means not saved to database.
Returns: Boolean true if the current record is a new record, false otherwise;
Sample
isRelatedFoundSetLoaded(relationName)
Returns true or false if the related foundset is already loaded. Will not load the related foundset.
Parameters
String relationName name of the relation to check for
Returns: Boolean a boolean when loaded.
Sample
revertChanges()
Reverts the in memory outstanding (not saved) changes of the record.
Returns: void
Sample
save()
Saves the in memory outstanding (not saved) changes of the record and stops its editing.
Returns: Boolean true if the save was done without an error.
Sample
Last updated