Fields
Fields represent the data elements of a composite type, defining how data is stored, processed, and interacted with.
Characteristics:
- Name: A human-readable identifier.
- Data Type: Defines the kind of data stored (e.g., String, Integer, or reference to another composite type).
- System Name: (Optional) Used in code and database table columns for more readable referencing.
- Field ID: A unique ID for internal references, especially when system names are not defined.
- Persistence: Fields are stored in the database unless marked as Transient, where each composite type has its own table.
- System Fields: Automatically added fields like
id
,metaObject
,serialNumber
, andrelativeOrder
are used for internal management.
Types of Fields:
- Regular: Store primitive types (e.g., text, numbers) or references to other composite types. Regular fields can either hold values directly or references to other types (value vs. reference behavior).
- Collection: Hold multiple values, much like lists or arrays. Collections can be of both embedded and composite types. The concept of virtual collections allows for efficient handling of large datasets.
- Shared: Reused across different composite types, maintaining consistency and sharing the same ID in underlying database tables.
- Dynamic: Untyped fields that reference any composite type containing a metaObject field.
Field events
Fields can trigger specific events related to value selection or changes resulting from user interaction. Developers can handle these events by implementing block-based event handlers known as field actions, allowing them to define custom logic for specific field-related events. This flexibility enables dynamic behaviors and interactions, such as validation or data recalculation, based on how the user interacts with the field.