Specialized Attributes
Primary Keys and Sequence Numbers
Each record in a repository has a unique record ID attribute called a key. The record’s unique, identifying key is called its primary key. Primary keys are often auto-generated.
If the primary key is an auto-sequenced attribute field and EnterWorks has been configured to allow the user to set its value, if the user enters a value, it will be saved. If the user has not, EnterWorks will generate the field value based upon the next number in the sequence and any configured rules. Once the new record is saved, the value of the auto-sequenced field is typically configured so that it cannot be changed. EnterWorks can be configured to generate unique identifiers across a set of repositories, so no duplicate identifiers will be generated or saved.
If the record’s primary key is not auto-generated and the user does not enter a primary key, the field will be left empty and an error for the record will be generated. If the user enters a value in a primary key attribute that has been used elsewhere in the repository, a duplicate identifier error for the record will be generated. EnterWorks may also be configured to ensure that within a set of repositories, no duplicate identifiers are generated or saved.
A record’s primary key is not to be confused with its sequence number. A sequence number only describes the order in which records are displayed in a Repository View, it is not used to identify the record.
Repository Sequences
Each record in a repository needs a unique ID to identify it. These IDs are tracked via a sequence object (also called a sequence or sequence definition), which keeps track of the IDs that have been used in that repository.
A sequence can be shared by multiple repositories, which would guarantee that each record has a unique id across all the repositories using that sequence. A use for this would be if products were being entered in multiple repositories but each product needed a unique product ID. Although a sequence definition can be shared by multiple repositories, it is recommended as best practice to create a separate sequence definition for each repository.
The default sequence object is commonly used if the user doesn’t care what the sequence numbers are as long as they uniquely identify each record.