Field Structure: Columns and definitions

Display Types for Fields in Modules

Each field has to be displayed in two different ways for the Detail view and Edit view. Display type column defines a field to be displayed either in Edit view or the Detail view or both.

The following are some of the display types that are used:

  • 1 - Displayed both in Detail view and Edit view
  • 2 - Displayed only in the Detail view (Ex. Created time, Modified time) Read-only field. The application will never update this type of field, the only way to set a value is using direct SQL (save_module or custom handler, for example)
  • 3 - It is not displayed either in DetailView nor EditView, but can be shown in ListView. For example Total, subtotal in Invoice Module. These Fields are not tied to any block.
  • 4 - a Read-Only field that can be modified with workflows. NOTE if you want to save a displaytype 4 field from inside your custom code using the normal “save” method, you MUST trick that save to think it is being called from the workflow system by setting the $from_wf global variable to true before the save (and back to false after)
  • 5 - Only in create mode. Cannot be used in workflows

typeofdata for Fields in Modules

typeofdata data type
CCheckbox/Boolean
DDate
DTDateTime
EEMail
IInteger
NNumber
NNNegative Number
ORecurringType/Duration_minutes
PPassword
TTime
VVarchar

Examples: extracted directly from the database

typeofdata
C~O
DT~M~time_start
DT~M~time_start~Time Start
D~M
D~M~OTH~GE~date_start~Start Date & Time
D~O
D~O~OTH~GE~sales_start_date~Sales Start Date
D~O~OTH~GE~start_date~Start Date
D~O~OTH~GE~support_start_date~Support Start Date
D~O~OTH~G~start_period~Start Period
E~M
E~O
I~M
I~O
NN~O
N~M
N~O
N~O~10,2
N~O~2,2
N~O~2~2
O~O
P~M
T~M
T~O
V~M
V~O
V~O~LE~150
V~O~LE~16
V~O~LE~25
V~O~LE~4
V~O~LE~9

In the above examples:

  • M; Indicates Mandatory field
  • O; Indicates Optional field

Basic Validations on Numbers and Dates

On numeric and date fields you can add some more information on the typeofdata column in order to perform some basic validations when editing.

Numeric fields accept a comparison operator followed by a number to use in the comparison.

N~O~LE~22

will assure that the number in this field is smaller or equal to 22

Date fields accept the same comparison operator followed by the field name of another date field being edited in the browser and will make sure that the relation indicated by the operator is true.

D~O~OTH~GE~dateinservice~Date in Service

the date in this field will be equal to or bigger than the value in dateinservice field

Accepted comparators are: L,LE,E,NE,G,GE

Mass Edit

  • 0 is blocked non editable, it cannot be activated in layout editor
  • 1 is mass editable
  • 2 is disabled mass editable but can be enabled in layout editor

Quick Create

  • 0 is always shown and cannot be deactivated in the layout editor
  • 1 is not shown but can be set in the layout editor
  • 2 is shown but can be unset in the layout editor
  • 3 is never shown and cannot be activated in the layout editor

Presence

  • 0 always active, cannot be modified in layout editor
  • 1 inactive
  • 2 active and editable

coreBOS Documentación