ViewRecord
Last updated
Was this helpful?
Last updated
Was this helpful?
A ViewRecord
represents a row in a ViewFoundSet
, with functionality tailored to handle specific record-related operations. Key properties include exception
, which provides information on the last exception that occurred for the record, and foundset
, which references the parent foundset. The recordMarkers
property facilitates validation by retaining markers for issues until a record is successfully saved or manually cleared.
The ViewRecord
object includes methods for examining and managing record state. For instance, getChangedData
retrieves unsaved changes in a dataset format, while hasChangedData
and isEditing
determine whether the record has pending modifications. The createMarkers
method allows manual creation of validation markers. Other methods, like revertChanges
, undo unsaved modifications, and getPKs
fetch the primary key values of a record. Additionally, isRelatedFoundSetLoaded
verifies if a related foundset is already initialized without triggering its load.
For more information on managing records within the context of view foundsets, refer to the section of the documentation.
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 succesful.
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 or false if the record has changes 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.
Returns last occurred exception on this record (or null).
Sample
Returns parent foundset of the record.
Sample
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 succesful.
Sample
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.
Sample
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 foundset.getEditedRecords().
Sample
Returns the records datasource string.
Sample
Returns an array with the primary key values of the record.
Sample
Returns true if the current record has outstanding/changed data.
Sample
Returns true or false if the record has changes or not.
As opposed to isEditing() of regular records, this method actually returns whether there are unsaved changes on this record, since there is no edit mode for view records.
Returns true if the current record is a new record or false otherwise. New record means not saved to database. Because this record is part of a view foundset, this method will always return false.
Sample
Returns true or false if the related foundset is already loaded. Will not load the related foundset.
Parameters
Sample
Reverts the in memory outstanding (not saved) changes of the record.
Returns: void
Sample
Type The occurred exception.
Type The parent foundset of the record.
Type The last validtion object if the record was not validated.
Returns: A new validation object.
Returns: a JSDataSet with the changed data of this record.
Returns: The datasource string of this record.
Returns: an Array with the pk values.
Returns: true if the current record has outstanding/changed data.
Returns: true if unsaved changes are detected.
Returns: true if the current record is a new record, false otherwise;
relationName name of the relation to check for
Returns: true if related foundset is loaded.