Events
This page contains links to callbacks and the api available to Data Abstract client and server scripts.
Note that the value in the {}, after the function name & arguments, indentifies whether the function is available to server side scripts, globally, per command or table.
Functions
afterCommit() {Server, Global}
Called just after a transaction (set of insert/update/delete) has been committed.
afterGetData(names, requestInfos) {Server, Global & Per Table}
Called after a request for data is sent.
nameswill contain an array of table namesrequestInfosis an array of the TableRequest objects.
afterExecuteCommand(sql, commandName, parameterNames, parameterValues, rowsAffected) {Server, Global & Per Command}
Called after an SQL command is executed.
sqlcontains the SQL to executecommandNamethe name of the commandparameterNamesis an array of parameter namesparameterValuesis an array of object valuesrowsAffectedcontains the number of rows affected by this command
afterLogin() {Relativity, Global}
Called after a user has logged in (for Relativity only).
Note: the afterLogin method is called only when the Relativity server uses a Login Provider.
afterProcessDelta(delta) {Server, Global & Per Table}
Called for each delta on the server after it is applied. Any changes to the delta will only be sent back to the client.
deltawill be of Delta type.
afterProcessDeltaChange(delta, change, wasRefreshed) {Server, Global & Per Table}
Called after a change is applied to the database.
deltawill be of Delta typechangewill be of DeltaChange type.wasRefreshedis true if the record was refreshed during processing delta change (it is actual if delta change contains Server Autorefresh fields), otherwise it is false
afterRollback() {Server, Global}
Called just after a transaction (set of insert/update/delete) is rolled back (canceled).
beforeCommit() {Server, Global}
Called just before a transaction (set of insert/update/delete) has been committed.
beforeDelete(row) {Server & Client, Per Table}
Called when the client (or server, depending on the schema settings) deletes a record. Call the global fail() method from here to stop the change from occurring.
rowis an object implementing theIRowHelperinterface. Client-side this will be the data row to be deleted, while server-side the method argument will be a corresponding DeltaChange Object.
beforeGetData(names, requestInfos) {Server, Global & Per Table}
Called before a request for data is sent.
nameswill contain an array of table namesrequestInfosis an array of TableRequest objects.
beforeExecuteCommand(sql, commandName, parameterNames, parameterValues) {Server, Global & Per Command}
Called before an SQL command is executed.
sqlcontains the SQL to execute,commandNamethe name of the command.parameterNamesis an array of parameter namesparameterValuesis an array of object values
beforeLogout() {Relativity, Global}
Called after a user has logged out (for Relativity only).
Note: the beforeLogout method is called only when the Relativity Server uses a Login Provider.
beforePost(row) {Server & Client, Per Table}
Called before a change to a record is accepted. Call the global fail() method from here to stop the change from occuring.
rowis an object implementing theIRowHelperinterface. Client-side this will be the data row to be changed, while server-side the method argument will be a corresponding DeltaChange Object.
beforeProcessDelta(delta) {Server, Global & Per Table}
Called for each delta on the server before it is applied. Any changes to the delta will be posted to the database.
deltawill be of Delta type.
beforeProcessDeltaChange(delta, change, wasRefreshed, canRemove) {Server, Global & Per Table}
Called before a change is applied to the database. Any implementation should return the current value of canRemove unless it is changed.
deltawill be of Delta typechangewill be of DeltaChangewasRefreshedcontainstrueif the record was refreshed.canRemovecontainstrueif the record is currently allowed to be removed (if it is a delete).
beforeRollback() {Server, Global}
Called just before a transaction (set of insert/update/delete) is rolled back (canceled).
onCreateTransaction() {Server, Global}
Called when a new transaction is created to fetch or update records.
onNewRow(row) {Client, Per Table}
This function can be used to initialize a new records' default values.
rowis an object that represents a new data row with the values that can be read or written to. Row values are accessible by index and by name.
onProcessError(delta, change, canContinue, error) {Server, Global & Per Table}
Called when an error occurs while applying a change. Should return the current value of canContinue, or false to stop trying the next change.
deltawill be of Delta Object type.changewill be of DeltaChange Object type.canContinuewill be the current value ofcanContinueset by any previous events.errorcontains the error message.
onUnknownSqlMacroIdentifier(name) {Server, Global}
Called when an unknown macro is used from within an SQL statement. Should return the new value.
nameis a string containing the macro.
onValidateCommandAccess(name, parameterNames, parameterValues, currentlyAllowed) {Server, Global & Per Command}
Called before a command is executed; should return true if access is allowed.
namecontains the command name.parameterNamesis an array of parameter names.parameterValuesis an array of object values.currentlyAllowedwill contain the information whether the data table is accessible according to the current rules.
onValidateDataTableAccess(name, parameterNames, parameterValues, currentAllowed) {Server, Global & Per Table}
Called during the validation of a request (fetching) for a data table. Should return true if access to that table should be allowed.
nameis the data table name.parameterNamesis an array of parameter names.parameterValuesis an array of object values.currentlyAllowedwill contain the information whether the data table is accessible according to the current rules.
onValidateDirectSQLAccess(sql, parameterNames, parameterValues, currentAllowed) {Server, Global}
Called when a user executes raw SQL. Generally, this function is disabled but can be allowed by returning true here.
sqlcontains the raw SQL.parameterNamesis an array of parameter names.parameterValuesis an array of object values.currentlyAllowedwill contain the information whether the data table is accessible according to the current rules.