company logo

DBBaseContext :: doAfterCreate - After create handler

The after create handler is called when a data instance has been created. (DBO_Created event). The handler is called before the DBO_Inserted event (doAfterInsert() handler).

The instance has already been stored to the database, but not yet inserted to the collection and its super sets. One may add instances to references or relationships, but one must not change key attribute values, which may lead to index inconsistency.

The handler can be overloaded in specialized type context class implementations.

Notes:

When creating instances for relationships based on the same super set as the current collection, key checks and __AUTOIDENT settings will not perform well, since the instance created has not yet been added to the collection. Hence, the application has to check proper key values or provide the __AUTOIDENT value explicitly.

Return value:  Execution error ( int32  )

The value is usually returned from context functions or actions in order to report the result of execution. The variable may contain following values:

  • -1: function/action not executed
  • 0: function executed normally
  • 1-9: Function executed with errors. Error codes depend on the function/action called.

Implementation details

int32 DBBaseContext  :: doAfterCreate (  )