Naming Conventions
For consistency, the following naming conventions are used in Trayse Inventory.

Tables

Table names are capitalized without spaces. Examples:
  • ITEM
  • ITEMSUBSTITUTION
  • RECEIPTLINE

Table Template

A table template has the default fields (see below) and is used to create new tables. Copy the template and rename.
Table names are in all caps. Table template at the top.

Fields

With a few exceptions, every table has 8 default fields:
  1. 1.
    constant_1 (auto-calc defined as 1)
  2. 2.
    ID (primary key, uses Get ( UUIDNumber ) )
  3. 3.
    notes
  4. 4.
    referenceNum
  5. 5.
    zzCreated (creation timestamp)
  6. 6.
    zzCreatedBy (creator)
  7. 7.
    zzModified (modification timestamp)
  8. 8.
    zzModifiedBy (modifier)
Fields are lower camel case. Examples:
  • dimensionUnitOfMeas
  • manufCategory
  • price

Constants

Constants have an underscore between the word "constant" and its value. The values matches the field value. Examples:
  • constant_1
  • constant_Yes
  • constant_Active
Constants are auto-enter calculation fields. As such, the field has no value for existing records and must be manually populated (e.g. server side script).

Globals

Globals are appended with an underscore and lower case "g". Examples:
  • itemID_g
  • targetWarehouseID_g

Calculations and Summaries

Unstored calculations and summary fields are used sparingly with a preference toward indexed fields updated by a script.
Stored calculations can be helpful for concatinating fields in the same table.

Booleans

Boolean fields start with the word "is". Examples:
  • isRMOrWip
  • isSerialized
  • IsWipOrFg
Field names.
Boolean fields are auto-enter calulations with the following formula:
GetAsBolean ( Self )
Booleans are displayed as a checkbox, using the value of 1. A separate value list exists with 0 and 1, but this is not the list to use with boolean fields. The GetAsBoolean () function will correctly toggle the value between 0 (not checked) and 1 (checked) when using a checkbox. The boolean field also has a validation with the 1 value list.

Field index

Not all fields are indexed. Quick Find is not used on any layout, but can be used as part of customization. Fields used on a layout where Quick Find is active should be marked as either included or excluded from Quick Find to properly manage field indexing.

Comments

Many fields have comments, particularly if the field name does not easily convey the data the field should have. If a limited set of values are expected (e.g. boolean fields or a small value list), those values are listed. Auto-enter fields show the default value.
Field comments, including default values, where applicable.

Scripts

Script titles are lower case. Any expected parameters to be passed are shown in parenthesis. Example:
  • refresh portal (portalObject, commit)
Optional parameters are shown in brackets. Example:
  • export-import path (fileName, [fileType, location])
Comments and spaces are used throughout the scripts. Lengthy scripts use various comment styles to clarify sections of the script.
Every script ends with the script step Exit Script.
A timestamp signature and description are at the bottom of the script. This allows for a log to be built at the bottom of the script without interrupting the readability of the script.
The timestamp signature takes the following formula:
2020-Nov-08 20h08 [email protected]
Text expander apps for Windows and Mac simplify the process of adding a timestamp signature.
Script log at the end of the script.
Script information (or meta data) is at the end of the script, not the beginning.
Not every script requires a description, particularly short scripts that are well named.
Short script with time signature. No description required.
Script folders that handle business logic are in capitals. Script folders that are utilitarian are in proper case. Scripts within the folders are in alphabetical order, with occassional exceptions.
A "Read Me" script is often part of the folder.
Scripts within a folder. Scripts are in alphabetical order.
Some scripts are "calling scripts" where the main purpose is to call various subscripts. Those subscripts may be listed below the calling script and prepended with a few spaces.
The open script is a calling script. Subsequent scripts are prepended with a few spaces.

Layouts

User interface layouts are Proper case and match the table name when possible. User interface layouts for lists are appended with "_l" (lowercase L). Developer tables (i.e. tables for scripts and development purposes) are in capitals and match the table name. They are appended with a "_d". These layouts are empty. An analysis table may exist, if a developer needs to see data on a developer layout.
Layout folders are in Proper case.
User interface layouts at the top. Developer layouts with some analysis layouts at the bottom.
Copy link
Outline
Tables
Table Template
Fields
Constants
Globals
Calculations and Summaries
Booleans
Field index
Comments
Scripts
Layouts