Fields

Describes entity field information. Fields are mapped to columns in databases and at the same time they are used to be displayed in screen sections.

Important

Following accepted naming conventions is especially important when it comes to fields. If you use a strong naming convention, it will save you a lot of work later on, when you will create database queries, user interfaces or business logic rules.

Entity Field Types

Common Attributes

AllowNulls True if values in this field can contain null values. False if null values are forbidden.
AutoIncrement True if this field's values should auto-increment. DataType must be Integer. When used on a virtual field it will automatically number all records starting from 1. This can be used as a virtual primary key if the data in the database have no key or if the data will be aggregated.
Caption

Description of the field which will be shown to users on screens.

This value can be overriden in a data structure field and also on the screen section widgets.

DataLength In case that DataType is String, this value sets the maximum length of the text field. It automatically sets the maximum size check of text boxes in screens.
DataType Specifies a data type of this field.
DefaultLookup

If the field is a reference to another entity, you can select a data lookup. This lookup will be then used as a default lookup for drop-down box lists in a User Interface Designer. It will also be used to substitute id with a looked-up value in data structures.

The lookup is also used by the Data Audit Log for storing the textual representation of the value instead of just the id.

This value can be overridden in a data structure field.

DefaultValue

If the default value is expected when inserting a new record (either by user interface or workflows), here you can specify a data constant, which will be used as a default.

AllowNulls must be set to False in order to DefaultValue be active.

DefaultValueParameter

A parameter that will be used for assigning the default at run time. This is useful when you want to pass the defaults when calling the data structure. You can also use one of the system parameters (e.g. parCurrentUserId). This way you will be able to assign automatically e.g. a current user to the data field.

When no value is passed, the DefaultValue constant is used.

ExcludeFromAllFields

If set to True the field will not be included in the list of fields in a data structure if AllFields = True is set in the data structure entity. This is useful e.g. for database function calls which are expensive and to be only used for specific queries or lookups and would otherwise slow-down the system if loaded e.g. by screens.

If you want to use such a field you need to add it specifically as a new data structure field.

IsPrimaryKey True if this field defines a primary key. If the entity contains a multi-column primary key, you can select more fields as primary key.
OnCopyAction

Specifies an action to be used when a user copies/duplicates a record.

  • Copy - The value will be copied (default).
  • Initialize - The value will be initialized (emptied or filled with a default value if specified)
  • PrependCopyText - The value will be copied and a "Copy of ][original text]" will be prepended. This can only be used for string fields.
XmlMappingType

Specifies how the value will be mapped when accessing the data using XML (e.g. in APIs or XSL Transformations).

  • Element - The value will be rendered as an XML element (e.g. <MyField>value</MyField>)
  • Attribute - The value will be rendered as an XML attribute (e.g. <MyEntity MyField="value"/>)
  • Hidden - The value will be hidden from the XML.

This value can be overriden in a data structure field.

ForeignEntity

If the field is a reference to another entity, here you can specify that entity.

Foreign keys will be included in the DDL scripts when using the Deployment Script Generator and corresponding foreign-keys will be created in the database. The checks will be done on database level only.

The foreign-key information is also be used by the DataService.UpdateReferences method to automatically help you with data deduplication.

ForeignEntityColumn This attribute specifies a primary key to which this field is related.