Specifying the Action to Take

From InterBase

Go Up to Handling Cached Update Errors


UpdateAction is a parameter of type TUpdateAction. When your update error handler is first called, the value for this parameter is always set to uaFail. Based on the error condition for the record that caused the error and what you do to correct it, you typically set UpdateAction to a different value before exiting the handler. UpdateAction can be set to one of the following values:

UpdateAction values
Value Meaning

uaAbort

Aborts the update operation without displaying an error message

uaFail

Aborts the update operation, and displays an error message; this is the default value for UpdateAction when you enter an update error handler

uaSkip

Skips updating the row, but leaves the update for the record in the cache

uaRetry

Repeats the update operation; correct the error condition before setting UpdateAction to this value

uaApplied

Not used in error handling routines

If your error handler can correct the error condition that caused the handler to be invoked, set UpdateAction to the appropriate action to take on exit. For error conditions you correct, set UpdateAction to uaRetry to apply the update for the record again.

When set to uaSkip, the update for the row that caused the error is skipped, and the update for the record remains in the cache after all other updates are completed.

Both uaFail and uaAbort cause the entire update operation to end. uaFail raises an exception, and displays an error message. uaAbort raises a silent exception (does not display an error message).

Note:
If an error occurs during the application of cached updates, an exception is raised and an error message displayed. Unless the ApplyUpdates is called from within a try...except construct, an error message to the user displayed from inside your OnUpdateError event handler may cause your application to display the same error message twice. To prevent error message duplication, set UpdateAction to uaAbort to turn off the system-generated error message display.

The uaApplied value should only be used inside an OnUpdateRecord event. Do not set this value in an update error handler. For more information about update record events, see Creating an OnUpdateRecord Event Handler.

Advance To: