Codebook Setup
A Codebook is a defined set of entities that establish the rules for the usage of the data. It is static and serves as a foundation for the app. They are available from any piece of code, which makes them useful for business logic and state machines.
Every Codebook entry has the Code
attribute generated by default.
Codebooks can be accessed in code through the static object: Codebooks
.
Create a Codebook
On the Codebook subsection, click (+)
to create a new entry. Or type Ctrl + Shift + C
to access the general create dialogue.
General
Name (required) – Name for the codebook.
Name (plural) – Plural of the codebook name (generated automatically)
Code Identifier – Code representation (i.e., no spaces) for the codebook
Inherited Aspects – Sets of attributes and/or references that the codebook would inherit (see Aspects).
Automatic Actions
Create Display Attribute – Mark the checkbox to define how this attribute will be displayed. A common display attribute is: item.Name
; it is provided by default.
Codebook Tab
There are three parts to a codebook display: Entries, Data Definition, and Settings.
The initial visit shows an empty grid.
Entries
The entries of the codebook are the default setting.
To create or edit Codebook Entries click Edit Entries
. You can then either add the Entry manually by clicking Add New Entry
and then type in its Code, Name and other values depending on what attributes your codebook has. Or you can copy and paste like-sized spreadsheets (i.e., same number of columns).
Code – The code for the entry.
Name – The name for the entry.
Keep in mind that you can't delete the Codebook's entries once the app is released. However, you can still edit it as you wish.
Data Definition
The Data Definition tab includes sections for Attributes and References.
Attributes
Create New Attributes
Attributes define the properties for a field, a tag in the database, or a string of characters.
Click Create Attributes
to add the new values to the list.
Attribute Name – The name for the attribute.
Type – Choose from String, Rich-text Markdown, Rich-text HTML, Integer, Decimal, Boolean, Date, Date and Time. The underlined letters that are shown in the user interface are shortcuts. Both “Date” and “Date and Time” can be marked to allow null values.
Existing Attributes – Click to see the attributes that already exist to help you determine the necessity for additional ones in the grid above.
You can delete the attribute by clicking (x)
that appears when you hover over the attribute name. It is also possible to copy the data from the atribute (see Copy Attribute).
References
References show the connections to the other codebooks. Click Add New Reference
.
Name – The name for the reference. Code Identifier – The code for the reference. Type – Select from the available types. Referenced Codebook – Establish connections to other codebooks.
Settings
Settings are the basic details for the codebook.
Settings
Name – Name for the codebook.
Name (plural) – Plural of the codebook name
Code Identifier – Code representation for the codebook
User interface
Inherited Aspects – Sets of attributes and/or references that the codebook would inherit (see Aspects).