Format Registry entry (field specific)
Specify two separate features on a per field basis: case-conversion, and uniqueness checking and auto-incrementation. A field may use one or the other feature, not both. Which functionality is invoked depends on the format string entered.
Be aware that this field-specific Registry entry is distinct from the Format Registry entry (system-wide), which is for setting global formats on latitude and longitude, date and time fields.
With this variation of the Format Registry entry it is possible to specify automatic case-conversion of data on a per column basis.
Any column in EMu can be configured for automatic case conversion so that regardless of the case of the data entered into a field, it will display in the case format specified by the Registry entry for that field.
Note: The conversion occurs when the user exits a field. Case conversion does not effect values entered in fields in Search mode.
Usage
Key | User | User | Group | Group | Group | Group |
---|---|---|---|---|---|---|
Key 1 | User
|
User
|
Group
|
Group
|
Group
|
Group
|
Key 2 | user | user | group | group | Default
|
Default
|
Key 3 | Table
|
Table
|
Table
|
Table
|
Table
|
Table
|
Key 4 | table | Default
|
table | Default
|
table | Default
|
Key 5 | Format
|
|||||
Key 6 | column or Default |
|||||
Value | format |
User
|
user | Table
|
table | Format
|
column | format |
User
|
user | Table
|
Default
|
Format
|
column | format |
Group
|
group | Table
|
table | Format
|
column | format |
Group
|
group | Table
|
Default
|
Format
|
column | format |
Group
|
Default
|
Table
|
table | Format
|
column | format |
Group
|
Default
|
Table
|
Default
|
Format
|
column | format |
User
|
user | Table
|
table | Format
|
Default
|
format |
User
|
user | Table
|
Default
|
Format
|
Default
|
format |
Group
|
group | Table
|
table | Format
|
Default
|
format |
Group
|
group | Table
|
Default
|
Format
|
Default
|
format |
Group
|
Default
|
Table
|
table | Format
|
Default
|
format |
Group
|
Default
|
Table
|
Default
|
Format
|
Default
|
format |
where:
column |
is a back-end column name; or use |
|||||||
format |
can be one of the following values: |
|||||||
|
Proper nouns should have the first letter UPPER CASE and the remaining letters lower case:
Key | Setting |
---|---|
Key 1 | Group
|
Key 2 | Default
|
Key 3 | Table
|
Key 4 | eparties
|
Key 5 | Format
|
Key 6 | NamFirst
|
Value | ucfirst
|
After typing john into the First: (Person Details) field in the Parties module and leaving that field, the value will be converted to John.
Record status in all tables should appear as UPPER CASE:
Key | Setting |
---|---|
Key 1 | Group
|
Key 2 | Default
|
Key 3 | Table
|
Key 4 | Default
|
Key 5 | Format
|
Key 6 | SecRecordStatus
|
Value | uc
|
All fields in all databases should be lower case:
Key | Setting |
---|---|
Key 1 | Group
|
Key 2 | Default
|
Key 3 | Table
|
Key 4 | Default
|
Key 5 | Format
|
Key 6 | Default
|
Value | lc
|
With this variation of the Format Registry entry it is possible to specify uniqueness checking and auto-incrementation of values on a per column basis. Auto-incrementation is applied to a column that has one or more rolling values, for example a column that displays the next available number when a new record is inserted.
Notes:
- If default values are not specified for a column with an incrementing number, a value will not display automatically when a new record is created. It is necessary to trigger the auto-incrementation and display of the number. In other words, the field will remain blank until the auto-incrementation of the number is triggered.
Note: If the Format Registry entry only specifies an auto-incrementing number in a column, to trigger the display and auto-incrementation of the number: enter any non-digit character that is acceptable in a number field e.g. + or - and press TAB to exit the field. The next available number will display.
See Example 1 for details. - Non-incrementing components included in a format (e.g. %s in %s.%1^d or TEXT in TEXT.%1^d) must be entered into the field before the incrementing component is calculated. In this example, if no default value for %s has been specified for the field, the user would need to enter text in the field and press TAB before the auto-incremented number (%1^d) would be calculated. The same would be true if TEXT.%1^d is specified as the format. In this case, the user would have to key the word TEXT into the field before pressing TAB. This would exit the field and trigger the calculation and display of the auto-incremented number.
See Example 3 for details.
Note: By specifying an Insert Defaults Registry entry however, an auto-incremented value can display automatically when a new record is created.
Any column for which uniqueness checking and auto-incrementation is to be enabled MUST have the Unique attribute specified: the Unique attribute can be set using the Unique Index Indexing Registry entry.
Key | User | User | Group | Group | Group | Group |
---|---|---|---|---|---|---|
Key 1 | User
|
User
|
Group
|
Group
|
Group
|
Group
|
Key 2 | user | user | group | group | Default
|
Default
|
Key 3 | Table
|
Table
|
Table
|
Table
|
Table
|
Table
|
Key 4 | table | Default
|
table | Default
|
table | Default
|
Key 5 | Format
|
|||||
Key 6 | column | |||||
Value | format |
User
|
user | Table
|
table | Format
|
column | format |
User
|
user | Table
|
Default
|
Format
|
column | format |
Group
|
group | Table
|
table | Format
|
column | format |
Group
|
group | Table
|
Default
|
Format
|
column | format |
Group
|
Default
|
Table
|
table | Format
|
column | format |
Group
|
Default
|
Table
|
Default
|
Format
|
column | format |
where:
format | is constructed using the following values: | |||||||||||
|
Note: The format syntax is similar to C/C++/Perl printf style syntax with some restrictions and some extensions.
An institution wants the Event Number (EveEventNumber) in the Events module to be unique and auto-incremented. The format for the Event Number is:
- A text prefix: Event.
- The current year.
- An auto-incremented number.
- Each component separated by a hyphen (-), e.g. Event
-2014-1
The format specified is thus: %s-%Y-%1^d
When a user enters a value in the Event Number field, it is sent to the back-end, which separates it into the various components, determines which is the next immediate component to be incremented, increments that component to provide the next unique value, and finally reformats the value according to the format string.
Note:
For multi incrementing formats (e.g. %1^d-%2^d
) the user will need to revisit the field to trigger incrementation of the next component.
Values for non-incrementing components (e.g. text) must be provided by the user or, as we'll see in Example 1, an Insert Defaults Registry entry. It is not necessary to include values for known components, e.g. the current year if %Y
is used. (Of course, if you want to enter a number for a previous year, it would be necessary to enter that year).
Punctuation is ignored and superfluous punctuation is discarded once the value is reformatted.
Assuming a record has an Event Number of Event-2014-1
:
If a user entered: |
Result |
---|---|
Event-2014
|
A value of Event |
Event |
An error message would display warning that the value was not unique. |
Event |
A value of Event |
Event |
If a full value is entered, incrementation is not attempted, however uniqueness checking is performed. |
Click the example format for details:
An auto-incremented number. |
|
Three hyphen separated components; a leading prefix, a numeric (a four digit year), and finally an auto-incrementing number. |
|
|
A custom format to illustrate what is possible. The explicit text PRE, followed by a text value, then the explicit number 123, then an incrementing number and finally the explicit text SUF, all separated by full stops (periods). |
|
%1^d
An institution wants the Event Number (EveEventNumber) in the Events module (eevents
) to be unique and auto-incremented.
In this example the format for the Event Number is simply an auto-incremented number (1%^d
).
If the Unique attribute has not been set in the back-end on the EveEventNumber field, set it:
System|Setting|Table|eevents|Unique Index|EveEventNumber
Specify the Format Registry entry for this same field:
Group|Default|Table|eevents|Format|EveEventNumber|%1^d
Next time an Events record is created, and the next Event Number is unknown:
- Enter
+
in the Event Number field. - Press
TAB
to move to the next field.The next available number in the Event Number field will be determined and will display:
Note: If the format includes two auto-incrementing numbers, e.g. %1^d.%2^d, enter + in the field and press TAB to move to the next field. The first incremented number is calculated. Return to the field and enter + after the first incremented number and press TAB. The second incremented number is calculated.
%s-%
Y
-%1^d
An institution wants the Event Number (EveEventNumber) in the Events module to be unique and auto incremented. The Event Number comprises three hyphen separated components: a leading prefix, a numeric (a four digit year), and an auto-incrementing number:
- A text prefix: Event (
%s
) - The current year (
%Y
) - An auto-incremented number (
%1^d
)
The format for this value is: %s-%Y-%1^d
In the Events module, the value will display as: Event-2014-1
If the Unique attribute has not been set in the back-end on the EveEventNumber field, set it:
System|Setting|Table|eevents|Unique Index|EveEventNumber
:
- Specify the Format Registry entry for this same field:
Group|Default|Table|eevents|Format|EveEventNumber|%s-%Y-%1^d
Imagine that there are already three Events records with the following Event Numbers:
- Event-2014-1
- Event-2014-2
- Event-2014-3
Consider these scenarios:
A user types the following into the Event Number field in the Events module: |
When the user moves to the next field: |
---|---|
Event |
The value in the Event Number field will automatically change to: Event-2014-4 |
Event-2014 |
The value in the Event Number field will automatically change to: Event-2014-4 |
Event-2014-3 |
An error message is generated indicating that the Event Number must be unique. |
To fully automate the display of the Event Number, we could:
- Specify an Insert Defaults Registry entry (for all users, or perhaps for specific groups, each with their own Prefix). In this case, the entry is specified for all users:
Group|Default|Table|eevents|Insert Defaults|Events|EveEventNumber=Event
- The set of default values called Events must be active for the user / group (or all groups by default) - users can select it in the Defaults box:
or an Insert Defaults Selected Registry entry could be specified by the Administrator.
Now, whenever a new record is created in the Events module, the default value (
Event
) will automatically display in the Event Number field. This will trigger the Format Registry entry and the remainder of the Event Number (the year and auto-incremented number) will automatically display:
This example is a more complex illustration of what is possible with the Format Registry entry:
PRE.%s.123.%1^d.SUF
- The text
PRE
- Is followed by a text value
- Followed by the number
123
- Followed by an incrementing number
- Concluding with the text
SUF
- All separated by full stops (periods)
If this entry was intended to format the Accession Number in the Catalogue module, a Registry entry suitable for all users would be:
Group|Default|Table|ecatalogue|Format|TitAccessionNo|PRE.%s.123.%1^d.SUF
This example extends the previous.
Consider the following format for Accession Number in the Catalogue module:
%s-%s-%Y-%1^03d-
Collections
%s
is the name of a group- The second
%s
is the name of a group %Y
is the current year%1^03d
is an incrementing number from 001 to 999Collections
is a text suffix- All separated by dashes
A suitable Registry entry would be:
Group|Default|Table|ecatalogue|Format|TitAccessionNo|%s-%s-%Y-%1^03d-Collections
If no Insert Defaults Registry entry is specified, a user would need to enter two bits of text (separated with a space or some form of punctuation), e.g.
Acquisitions Managers (or Acquisitions.Managers or Acquisitions-Managers, etc.). Pressing TAB will trigger the Format entry to calculate the date, increment the number, add the text suffix and format the entire string with dashes.
- To fully automate the process however, we could specify an Insert Defaults Registry entry for each group.
For example, for Managers in the Acquisitions department we could specify the following:
Group|Managers|Table|ecatalogue|Insert Defaults|Manager Acquisitions|TitAccessionNo=Acquisitions-Managers
- We could also specify an Insert Defaults Selected Registry entry for the Managers group:
Group|Managers|Table|ecatalogue|Insert Defaults Selected|Manager Acquisitions
If we already have a Catalogue record with an Accession Number up to:
Acquisitions-Managers-2018-001-Collections
when a Manager in the Acquisitions Department next creates a record in the Catalogue module, the Accession No.: (Accession Details) field will be populated automatically as follows:
What takes place?:
The Insert Defaults Registry entry for the Managers group automatically populates the Accession No.: (Accession Details) field with the value:
Acquisition-Managers
This triggers the calculation and display of the remainder of the value: the Year is provided, followed by an incremented number, followed by the suffix Collections, with dashes separating each component of the value.
|
Four components separated by the hyphen character. The first (most significant) incrementing component, followed by a text value, the next incrementing component and finally the last (least significant) incrementing component. The final incrementing component uses the Hence for this format the value 1-A-2 is valid; it would not be valid if the @ character was not specified. |
|
A two column format. The first column is text, the second column is an incrementing number. |
|
A valid number is one in which:
|
|
Extends the previous example. A number is valid if an optional incrementing component is added. |
|
This example includes two incrementing numbers. For the System to calculate both numbers:
|