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.

Fields

With a few exceptions, every table has 8 default fields:

  1. constant_1 (auto-calc defined as 1)

  2. ID (primary key, uses Get ( UUIDNumber ) )

  3. notes

  4. referenceNum

  5. zzCreated (creation timestamp)

  6. zzCreatedBy (creator)

  7. zzModified (modification timestamp)

  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

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.

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 daniel@newleafdata.com

Text expander apps for Windows and Mac simplify the process of adding a timestamp signature.

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.

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.

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.

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.

Last updated