Business objects and documents primary key fields (identifiers) must have unique values. Unique value of new object/document identifier may be defined interactively by a user or generated automatically. Automatic identifiers should not appear on the HyperDoc "new object/document" form. Automatic identifiers may be generated by a database system (e.g. AutoNumber field in Access or IDENTITY column in SQL Server) or supplied by HyperDoc Add-In module responding to the NewObjectPrimaryKey event. We strongly recommend the second method because database systems use different methods for implementing automatically generated column values. HyperDoc properly handles AutoNumber field type in MS Access, but if you use other ODBC database system HyperDoc may have problem with creating new document and sending proper KeyValue with the NewObjectAdded event.

Of course to use this add-in the hierarchy of HyperDoc must include at least one type of objects requiring auto-numbering. The table HdocAutoID must include one record for each of such objects.

The simple solution applied in this add-in may cause concurrency problem. HyperDoc displays error message when identifier value is not unique. If such situation occurs the user should try again to add new object/document. Of course you can implement more sophisticated methods for example using timestamps.

If you use custom forms to define new object or document you can use any method to handle object/document identifier. HyperDoc expects that your custom form returns identifier value for the object/document just added.

loading table of contents...