Table
Reference documentation for a Table object
Last updated
Reference documentation for a Table object
Last updated
A Table object represents an individual table in a Database Server.
The properties for a Table are stored under in the resources directory in a Database Information (.dbi) File.
The following properties can be configured for a Table object
Property | Summary |
---|---|
The following events can be handled for a Table object.
Property | Summary |
---|---|
The following properties can be configured for a Table object
Use this property to hide the table from the Servoy Developer environment. When set to true, the table will be skipped when loading information about the database schema.
Type: String
Required: false
This event is a pre-trigger for a record insert. It is fired during a save event and gives the developer a chance to validate the record or make changes. Return false or assign error markers to prevent the insert.
Parameters
record: JSRecord - The record that will be inserted
recordMarkers: JSRecordMarkers - The object where all the problems can be reported
stateObject: Object - An object that a user can give to validateRecord for extra state (optional, can be null).
Returns: Boolean - Return false to prevent the record from being inserted.
Example
This event is a pre-trigger for a record update. It is fired during a save event and gives the developer a chance to validate the record to be updated. Return false or assign error markers to prevent the update.
Parameters
record: JSRecord - The record that will be updated
recordMarkers: JSRecordMarkers - The object where all the problems can be reported
stateObject: Object - An object that a user can give to validateRecord for extra state (optional, can be null).
Returns: Boolean - Return false to prevent the record from being update.
Example
This event is a pre-trigger for a record deletion. It is fired during a save event and gives the developer a chance to validate the record to be daleted. Return false or assign error markers to prevent the record to be deleted.
Parameters
record: JSRecord - The record that will be deleted
Returns: Boolean - Return false to prevent the record from being deleted.
Example
This event is a record after-insert trigger. This is an ideal mechanism to update the data model after data is known to have been inserted.
Parameters
record: JSRecord - The record that will be inserted
Example
This event is a record after-update trigger. This is an ideal mechanism to update the data model after data is known to have been updated.
Parameters
record: JSRecord - The record that will be updated
Example
This event is a record after-delete trigger. This is an ideal mechanism to update the data model after data is known to have been deleted.
Parameters
record: JSRecord - The record that will be deleted
Example
This event is a pre-trigger for a new record being created in the foundset. The event handler has the opportunity to prevent the operation to take place. This is an ideal place to set fail-safe data rules. When false is returned the record will not be created in the foundset.
Returns: Boolean - Return false to prevent the record from being created in the foundset.
Example
This event is a foundset pre-find trigger. The event handler has the opportunity to prevent the operation to take place. This is an ideal place to set fail-safe data rules. When false is returned the foundset will not go into find mode.
Returns: Boolean - Return false to prevent the foundset to enter find mode.
Example
This event is a foundset pre-search trigger. The event handler has the opportunity to prevent the operation to take place. This is an ideal place to set fail-safe data rules. When false is returned the search will not be executed and the foundset will stay in find mode.
Parameters
clearLastResults: Boolean - tells whether or not to clear previous search
reduceSearch: Boolean - tells to reduce (true) or extend (false) previous search results
Returns: Boolean - Return false to prevent the foundset to enter find mode.
Example
This event is a record after-create trigger. It occurs immediately following the operation executed on the foundset.
Parameters
record: JSRecord - The record that is created
Example
This event is a foundset post-find trigger. When false is returned the foundset will not go into find mode.
Example
This event is a foundset post-search trigger. When false is returned the foundset will not go into find mode.
Example
Record validation method, will be called by databaseManager.validateRecord() and when databaseManager.saveData() is called. It validates changes or state of the record. All errors need to be reported in the recordMarkers that is then returned by databaseManager.validateRecord() and is also placed on the record itself (record.recordMarkers).
Parameters
record: JSRecord - The record that must be validated
recordMarkers: JSRecordMarkers - The object where all the problems can be reported
stateObject: Object - An object that a user can give to validateRecord for extra state (optional, can be null).
Example