4D v14.3Field properties |
|||||||||
|
4D v14.3
Field properties
|
id name |
1 dog |
2 cat |
3 penguin |
4 snake |
5 butterfly |
6 ostrich |
This menu of options is only available for Text, BLOB and Picture type fields. You can set a storage location for the field data. The following options are available:
As described in the previous section, for optimization purposes, by default the data of BLOB, Picture and Text type fields are stored outside of records or outside of the data file.
In this configuration, it may be worthwhile, for performance reasons, to "force" data to be stored in the records when their size is limited. This functioning is particularly optimized when your application handles BLOB, Picture or text data of inconsistent sizes.
This setting is available via the Internal storage max size option. The value entered in this area represents the size in bytes below which the data of the field will be stored in the record. For example, if you enter 30 000 for a picture field, a 20 KB picture will be stored in the record and a 40 KB picture will be stored at the location defined in the settings (in the data file or outside it). By default, the value is 0: all the data of the field is stored outside of the records.
This property is available for Alpha type fields. It indicates that the field stores UUID identifiers. The stored data must conform to the UUID format (combination of 32 letters (A-F, a-f) and numbers (0-9)). To do this, you can use the Auto UUID property, the Generate UUID command, or any custom algorithm.
If you try to store a string that does not comply with the UUID format in this field, 4D converts it automatically. The same operation is also applied to the contents of existing non-Alpha fields that are transformed into UUID fields: when loading the records, the values are reformatted and then stored once again.
Fields with the UUID format property can be displayed in forms and remain enterable. Their contents appear in upper-case characters. You must pass through a variable if you want to display lower-case characters.
Notes:
This option is only active when you select the UUID format property.
You can use the Auto UUID property to generate a UUID number automatically in the field.
This number is calculated automatically in the following contexts:
Naturally, in all cases, the record must be saved in order for the automatically-generated UUID to be saved in the field.
Note: When data is imported, even with this property selected, 4D does not generate a new number but uses the imported values (and transforms them when necessary if the format is not valid). However, if the value of the imported field is empty, a UUID is automatically generated.
Compatibility note: This option has only been kept for compatibility reasons and does not have any effect by default. To be able to use it, you must enable QuickTime in your application (see Pictures).
This property is available for Text and Alpha fields. When you select this option, queries and sorts carried out in the data stored in the field do not take any style tags into account.
This option is related to the abilit of 4D to apply different styles within the same text area (rich text) in a form. For more information about this function, refer to Multi-style (Rich text area).
The setting of styles is done by inserting HTML tags in the text. These tags are interpreted when the text area is displayed.
Style tags are stored with the data. For example, if you write "week end" in a Text field, 4D stores "week <SPAN STYLE = "color: #D81E05">end</SPAN>". This operation is transparent for the user at the form level. However, for queries and sorts, a specific setting is necessary for 4D to ignore the style tags. For the word "week end", the query can find it only if you have selected the Queries and sorts on text without tags option for the field in the Structure editor.
Note: With this option, a query for thevalue among the data of thefield is the same as executing this statement within 4D:
QUERY BY FORMULA(OBJECT Get plain text(thefield)="thevalue")
The Index property is available for all field types except for BLOBs and Pictures. The Keyword Index property is available for fields of the Alpha, Text and Picture types.
Using indexes helps accelerate processing and searches among the data
Managing indexes is detailed in Creating and modifying indexes.
You can establish data entry controls for fields and enterable objects at the form level. Data entry controls restrict what the user can enter into the field or enterable object on a particular form.
When the Mandatory attribute is set for a field, the user must enter a value in that field during data entry. 4D does not accept a record that contains an empty mandatory field. You would set the Mandatory attribute for a field that contains essential information for your database. The field that uniquely identifies each record is a good candidate for the Mandatory attribute. Social Security numbers, invoice numbers, certain dates, or employee numbers might need to have the Mandatory attribute set to protect the integrity of the records.
You can also set this attribute for a field in a particular form. If you select the Mandatory attribute in the Structure editor, you cannot deselect it on a particular form. However, you can apply the Mandatory attribute on a form to a field that does not have this attribute in the Structure editor. For information about setting the Mandatory attribute for a field in a form, see the Enterable and Mandatory attributes and field properties section.
Note: In 4D, fields can also have the "Reject NULL value input" property (see above). The two concepts are similar but their scope is different: the “Mandatory” attribute is a data entry control, whereas the “Reject NULL value input” attribute works at the level of the database engine.
If this attribute is set for a field, 4D validates the value initially entered in the field, but does not allow the user to modify the value after the record has been saved. The user can edit an entry in such a field only during the initial creation of the record, before the record is validated. Once the user saves the record, the value in the field not editable. The value can then only be modified by a method or in the Design environment after you have first removed this option.
Use Can’t Modify for fields that must provide an audit trail such as Date Received, Date Paid, and so on. The Can’t Modify attribute is often used for the field that uniquely identifies each record in the table.
Note: This attribute only works on fields displayed in an input form in Page mode. In other cases (entry in list, entry in a subform in either List or Page mode), the value of the field can still be modified.
The user cannot enter values from the keyboard into a field that has the Display Only attribute set. You must use a default value for such a field or write a method that inserts a value in the field. A field with the Display Only attribute is useful for displaying values that you do not want database users to modify, such as calculated totals or a sequence number assigned by a method.
You can also make any field non-enterable on a particular form. For information about making a field non-enterable, see the Enterable and Mandatory attributes and field properties section.
This option is only available for Text type fields. When it is checked, the Text field is automatically configured, in forms created subsequently, so as to contain several lines of text. Its default characteristics are as follows:
When this option is not checked, the default appearance of Text fields in forms is the same as that of Alpha fields: a single line’s height and no scrollbar; a carriage return will move you to the next field of the form.
It is possible to change the default field appearance at any time using the Form editor.
Use the Allow Choice List attribute if you want to display a choice list for entering information in the field. To use this attribute, you first need to create the choice list using the Lists editor (see Lists).
Use the Allow Choice List attribute when you want to standardize entries in the field and avoid misspellings. Use a choice list for a field that has a limited number of valid entries or a limited number of usual entries. Using a choice list does not necessarily prevent the user from typing a different value (one that does not appear in the choice list).
You can also assign a choice list to a field on a particular form. However, when you assign a choice list only on a form, the list is not displayed in other editors and dialog boxes, such as the Query editor. For information about using a choice list in a form, see the section Data entry controls and assistance.
Note: It is also possible to set choices lists of required values and excluded values at the form level.
When you check the Allow Choice List option, the associated scrolldown menu is enabled. You can then select an existing choice list that you want to assign to the field or you can click on [...] to directly access the Lists editor (see Lists).
You can provide users with additional information about a field by adding a help tip to the field. When a tip is entered in the Help Tips area, it appears next to the field whenever a user places the pointer over the field in any form in which the field is included. A Help Tip is displayed on all platforms.
When the user places the mouse pointer over the field, the tip appears below the field, as shown below:
You can also use a help tip for a field in a particular form. If you assign a help tip only to a certain form, it will not appear in the other forms. For more information about using help tips with forms, refer to the Help messages section.
The Comments area of the Inspector palette can be used to store additional information about the field. These comments are available to all the developers.
Note that each table and relation has its own comments area.
The SQL area of the Inspector palette provides various useful information about the field from the perspective of its use via the SQL language.
This area indicates more particularly whether the name of the field respects the rules regarding SQL nomenclature (for example, unlike 4D, SQL does not allow a field name to contain spaces).
For fields, the SQL information area also indicates their SQL attributes (type and properties).
Product: 4D
Theme: Creating a database structure
4D Design Reference ( 4D v14.3)
Inherited from : Field properties ( 4D v14 R2)