4D v13.4

Data entry controls and assistance

Home

 
4D v13.4
Data entry controls and assistance

Data entry controls and assistance  


 

 

Using the Property List, you can set various properties that control and facilitate user data entry for active objects. Using these properties, you can:

  • Set attributes related to selection and data entry,
  • Set an entry filter that controls allowable characters,
  • Attach a choice list,
  • Establish a list of required or excluded values,
  • Set maximum and minimum values,
  • Set default values,
  • Set the object selection mode,
  • Display help messages.

The Enterable attribute indicates whether users can enter values into the object. It can be set in the “Entry” theme of the Property List for the Field and variable objects.

A field from a related table may not be enterable if you deselected the Enterable Related Fields check box in the Form Wizard. You can make the related field enterable by selecting the Enterable check box.

All active objects are enterable by default. If you want to make a field or an object non-enterable for that form, you can deselect the Enterable check box for the object. A non-enterable object only displays data. You control the data by methods that use the field or variable name. You can still use the On Clicked, On Double Clicked, On Drag Over, On Drop, On Getting Focus and On Losing Focus form events with non-enterable objects. This makes it easier to manage custom context menus and lets you design interfaces where you can drag-and-drop and select non-enterable variables.

Notes:

  • The contents of the Property List are contextual. When the Enterable attribute for a field or an object is deselected in the Property List, properties that are related to entry control (Mandatory, Tabable, Entry filter and so on) disappear from the list.
  • You can also set the Display only property for a field in the Structure editor (see UNREGISTER CLIENT. In this case, the Enterable option does not appear in the Property List for this field (see below).

Selecting the Mandatory check box makes a field or enterable object mandatory for that form. 4D does not accept a record if the field or object does not contain a value.

No field or enterable object is mandatory by default. To make the field mandatory for all forms, set the Mandatory attribute in the Inspector window in the Structure editor. If you want to make a field or enterable object mandatory for a particular form, you can select the Mandatory option in the object properties.

The Enterable and Mandatory attributes are similar to the field attributes you set in the Structure editor (see UNREGISTER CLIENT). If you want these attributes to be different on a particular form, you can modify them in the properties of each field. These attributes can be set in the “Entry” theme of the Property List for the Field and variable objects.

These attributes do not override the field attributes set in the Structure editor. If a field already has the Display Only attribute assigned in the Structure editor, you cannot make it enterable with the Enterable form attribute. If a field already has the Mandatory attribute assigned in the Structure editor, you cannot make it non-mandatory by deselecting the Mandatory form attribute. The Enterable and Mandatory check boxes do not necessarily reflect the attribute settings in the Structure editor.

Tabable  

You can set the Tabable attribute for each active object of the form. When this attribute is selected, the object is included in the entry order and will therefore be active when the user presses the Tab key.

By default, this attribute is checked for all the fields and enterable variables. If you deselect it, the object will be excluded from the entry order. However, it can still be selected by a mouse click or using a method.

For more information about the entry order, refer to Modifying data entry order.

You can check the Tabable property for a non-enterable object. In this case, you can select this object using the Tab key but without being able to enter values in it.

The Tabable property is only accessible if the Focusable property is selected. In other words, any tabable object can have the focus. However, some objects can be “focusable” while not being “tabable” (for example, an object can be selected by clicking it and not “tabable”). In this case, the object does not belong to the data entry sequence.

This property can be set in the “Entry” theme of the Property List for active objects (whether enterable or not) as well as for non-enterable fields.

When the Focusable property is selected for an object, the object can have the focus (and can thus be activated by the keyboard for instance). It is outlined by a gray dotted line when it is selected — except when the “Hide focus rectangle” option has also been selected (see the following section).

Check box shows focus when selected

Check box is selected but cannot show focus

When the Focusable property is selected for a non-enterable object, the user can select, copy or even drag-and-drop the contents of the area.

During execution, a field or any enterable object is outlined by a selection rectangle when it has the focus (via the Tab key or a single click). You can hide this rectangle by checking the Hide focus rectangle option. Hiding the focus rectangle may be useful in the case of specific interfaces.

You can assign a choice list to enterable form objects. You can use three types: regular choice lists, a list of required entries, or a list of excluded entries.

Choice lists are designated in the “Data Source” theme of the Property List while lists of required or excluded entries are designated in the “Range of Values” theme.

Before you can assign a choice list, you must have created the list in the Lists editor (see Lists).

Assigning a source choice list to a field with the Choice List drop-down list (“Data Source” theme) causes 4D to display the choice list automatically during data entry. The choice list appears when the field or enterable object is selected in the form being executed. The user can then select an entry from the list. The entry chosen from the choice list can be overwritten by typing (unless the list is also a required list).

A Required List (“Range of Values” theme) restricts the valid entries to the items on the list. For example, you may want to use a required list for job titles so that valid entries are limited to titles that have been approved by management.

Making a list required does not automatically display the list when the field is selected. If you want to display the required list, assign the same list with the Choice List drop-down list (“Data Source” theme).

An Excluded List prevents the items on the list from being entered. For example, for a field on an input form used only by employees, you may want to attach a list of choices that can only be entered by a manager

You can assign a choice list to a field at either the table or form level. If you want to assign the choice list at the table level, use the Inspector window in the Structure editor (see UNREGISTER CLIENT). The choice list will then be associated with this field in all the forms and search editors of the database. If you attach a choice list at the form level, it can serve as a choice list only for that form.

An entry filter controls exactly what the user can type during data entry. Unlike the data entry controls discussed earlier in this section, entry filters operate on a character-by-character basis. For example, if a part number always consists of two letters followed by three digits, you can use an entry filter to restrict the user to that pattern. You can even control the particular letters and numbers.

An entry filter operates only during data entry. It has no effect on data display after the user deselects the object. In general, you use entry filters and GET LIST ITEM PARAMETER together. The filter constrains data entry and the format ensures proper display of the value after data entry.

During data entry, an entry filter evaluates each character as it is typed. If the user attempts to type an invalid character (a number instead of a letter, for example), 4D simply does not accept it. The null character remains unchanged until the user types a valid character. 

Entry filters can also be used to display required formatting characters so that the user need not enter them. For example, an American telephone number consists of a three-digit area code, followed by a seven-digit number that is broken up into two groups of three and four digits, respectively. A display format can be used to enclose the area code in parentheses and display a dash after the third digit of the telephone number. When such a format is used, the user does not need to enter the parentheses or the dashes.

You create the entry filter by choosing a built-in filter from the Entry Filter drop-down list or by typing an entry filter code into the Entry Filter Display area. The Entry Filter drop-down list contains filters for date, time, and alpha objects. 

Most of the time, you can use one of the built-in filters of 4D for what you need; however, you can also create custom filters (see Formats and Filters editor). The names of any custom filters you create are added to the top of the Entry Filter drop-down list and begin with a vertical bar (|). 

You can modify an entry filter after you choose it from the drop-down list. For example, if you want to use a filter that allows upper and lowercase letters, but also need to allow the wildcard character (@), you could choose the filter:
    &"a-z;0-9; ;,;.;-"
and change it to:
    &"a-z;0-9; ;,;.;-;@"

Entry filter codes usually start with an ampersand (&). This character tells 4D to use what follows as an entry filter. If the code starts with a tilde (~), it means the same thing as “&” except that any letter is automatically made uppercase.
The & is usually followed with an “A,” an “a,” or a “9,” meaning allow only uppercase letters (A), allow lowercase and uppercase letters (a), or allow only numbers (9). For example, &9 allows only numbers and &A allows only capital letters. The number sign (#) tells how many digits or characters are allowed by the code. If the code uses no number signs, the filter allows as many digits or characters as you want. For example, &9 allows as many digits as entered. The filter &9## allows only two digits.
The exclamation point (!) is sometimes used to change which character will appear on screen to indicate the number of characters the user can enter. Without an !, 4D displays an underscore (_) for each digit or character the user can enter. For example, !?&9## displays question marks in both of the places the user will type and it allows only numbers and only two digits point. For information about creating entry filters, see Filter and format codes.

Here is a table that explains each of the entry filter choices in the Entry Filter drop-down list:

Entry FilterDescription
~AAllow any letters, but convert to uppercase.
&9Allow only numbers.
&AAllow only capital letters.
&aAllow only letters (uppercase and lowercase).
&@Allow only alphanumeric characters. No special characters.
~a##State name abbreviation (e.g., CA). Allow any two letters, but convert to uppercase.
!0&9##/##/##Standard date entry format. Display zeros in entry spaces. Allow any numbers.
!0&9 Day: ## Month: ## Year: ##Custom date entry format. Display zeros in entry spaces. Allow any numbers. Two entries after each word.
!0&9##:##Time entry format. Limited to hours and minutes. Display zeros in entry spaces. Allow any four numbers, separated by a colon.
!0&9## Hrs ## Mins ## SecsTime entry format. Display zeros in entry spaces. Allow any two numbers before each word.
!0&9Hrs: ## Mins: ## Secs: ##Time entry format. Display zeros in entry spaces. Allow any two numbers after each word..
!0&9##-##-##-##Local telephone number format. Display zeros in entry spaces. Allow any number. Three entries, hyphen, four entries.
!_&9(###)!0###-####Long distance telephone number. Display underscores in first three entry spaces, zeros in remainder.
!0&9###-###-###Long distance telephone number. Display zeros in entry spaces. Allow any number. Three entries, hyphen, three entries, hyphen, four entries.
!0&9###-##-###Social Security number. Display zeros in entry spaces. Allow any numbers.
~"A-Z;0-9; ;,;.;-"Uppercase letters and punctuation. Allow only capital letters, numbers, spaces, commas, periods, and hyphens.
&"a-z;0-9; ;,;.;-"Upper and lowercase letters and punctuation. Allow lowercase letters, numbers, spaces, commas, periods, and hyphens.
&"0-9;.;-"Numbers. Allow only numbers, decimal points, and hyphens (minus sign).

You often use a matching display format when you use an entry filter. An entry filter operates only during data entry. It has no effect on how the data is displayed after you tab out of the field. For example, if you use the Social Security number entry filter (&9###-##-####), you should also choose the matching Social Security number display format (###-##-####). Without the display format, only the numbers, not the hyphens, are displayed in the field. 

Here are some suggested entry filters and matching display formats for common types of fields:

Field TypeEntry FilterDisplay Format
State~a##(none needed)
Zip Code (standard)&9#####(none needed)
Zip Code (extended)&9#####-#########-####
Phone number&9###-#######-####
&9(###) ###-####(###) ###-####
&9 ###-###-#######-###-####
Date!0&9##/##/##(Any Date Format)
!0&9 Day: ## Month: ## Year: ##
Time!0&9##:##(Any Time Format)
!0&9## Hrs ## Mins ## Secs
!0&9Hrs: ## Mins: ## Secs: ##

You can use display formats on input forms, output forms, and Quick reports. For information about using display formats in Quick reports, refer to Setting column display formats.

You can restrict a Number, Date, or Time field or enterable object by entering maximum and minimum values in the corresponding entry areas in the “Range of Values” theme of the object properties.

During data entry, if the user enters a value below the minimum or above the maximum, a warning message is displayed. 4D returns the user to the field so that a valid entry can be made. 

To set a maximum or minimum value, type the value you want to define the limit. Use the data entry format appropriate for the type of field or enterable object for which you are setting a limit. For example, for a Date field or object, use the date entry format to set the maximum or minimum value.

The values you set are inclusive. That is, if the user enters the same value you have set as a maximum or minimum value, the entry is allowed. Only entries lower than the minimum or higher than the maximum are disallowed. For example, if the value you set as a maximum is 15, the user can enter 15, but not 16.

You can also use methods to restrict the values that the user can enter. With a method, you can give more precise and informative feedback to the user, or set minimum or maximum values based on other values in the database. For example, a method can check a customer’s credit limit before validating a new transaction.

You can also use a required choice list to create unusual ranges of allowable values. For more information, see the Required lists section above and the Creating and modifying lists section.

You can assign a default value to be entered in a field or enterable object. The default value is entered when a new record is first displayed. You can change the value unless the field or entry area has been defined as non-enterable.

You create a default value by typing the value you want in the Default Value entry area in the “Range of Values” theme of the Property List. The default value must be appropriate for the field type. 4D provides stamps for generating default values for the date, time, and sequence number. The date and time are taken from the system date and time. 4D automatically generates any sequence numbers needed. The table below shows the stamp to use to generate default values automatically:

StampMeaning
#DCurrent date
#HCurrent time
#NSequence number

VYou can use a sequence number to create a unique number for each record. A sequence number is a longint that is generated for each new record. The numbers start at one (1) and increase incrementally by one (1). A sequence number is never repeated even if the record it is assigned to is deleted from the table. Each table has its own set of sequence numbers. For more information, refer to the Sequence number command in the 4D Language Reference manual.

If the object displays a list of values (such as a combo box, scrollable area, pop-up menu, tab control, or drop-down list), you can specify a list of values that will be used as default values. The list will be loaded into the object prior to its being displayed on the form. 

For objects that accept a list of default values, the Default Value area becomes a button:

When you click this button, the Default values dialog box appears:


Enter the list of default values. Each value should be on a separate line. Click OK to put away the Default values dialog box and return to the Property List window.

When you enter default values into the Default values dialog box, they are automatically loaded into an array whose name is the name of the object. Using the language, you can manage the object by referring to this array.

Notes:

  • You can also use a list that you created using the Lists editor to set default values for hierarchical lists or tab controls.
  • You can also set default values using a method. For objects that accept one, you can assign the default value when the On Load event executes in the object or form method. 
  • For objects that accept lists, you can enter the default values using the Lists editor and then use the Load list command in order to create a hierarchical list. You can then work with the list and its contents using the commands of the “Hierarchical Lists” theme. You can load the lists into a hierarchical list when the On Load form event occurs or load all lists in the On Startup database method.

Compatibility Note: This option is only taken into account when the database is running in non-Unicode mode. In Unicode mode, it is ignored. For more information, refer to the documentation for previous versions of 4D.

4D includes an integrated spell-check utility that is available in several languages. Alpha and Text type variables and fields can be checked, as well as 4D Write documents.

The Auto Spellcheck property (“Entry” theme) activates the spell-check for the object. In this case, the spell-check is done automatically during entry, once the object loses the focus.

Note: You can also execute the SPELL CHECKING command for each object to be checked.

Regardless of how the spell-check feature is activated, the following dialog box appears if an unknown word is detected:

Several buttons are available:

  • Ignore: The unknown word is kept as is.
  • Ignore all: The unknown word is kept as is and all other occurrences of the word in the area are also kept.
  • Add: The unknown word is added to the dictionary; it will no longer be detected by the spell-check feature.
  • Change: The unknown word is replaced by the word shown in the correction area.
  • Change all: The unknown word and all other occurrences of the word are replaced with the word shown in the correction area.
  • Close: No correction is made and the dialog box is closed.

Note: When you click a button other than the Close button, the spell-check continues until it reaches the end of the area.

The 4D spell-check can use four dictionaries: English, French, German, and Spanish. By default, 4D uses the dictionary corresponding to the current language of the application. 

You can, however, force the opening of a dictionary in a different language using the SPELL SET CURRENT DICTIONARY command. 4D lets you set up and use specialized dictionaries for each language, including lists of custom words accepted by the spell-check. For more information about setting up these dictionaries, refer to Appendix D: Use of specialized dictionaries.

You can add a help message to fields and active objects in your forms to help users work with your database more productively. Help messages will appear as tips.

For example, you can create a help message for a Date field which reminds the user to include a separator such as the slash mark (/) between the month, day, and year when entering data. 

The help tip appears in the form whenever the mouse moves over the field or object:

Note: You can also associate a help message with a field at the level of the database structure. In this case, the help tip of the field is displayed in every form where it appears. For more information, refer to “Help Tips” in UNREGISTER CLIENT. If two different help tips are associated with the same field in these two locations, priority is granted to the help tip set at the form level.

You can associate a help tip with any active object in your form by using the Help Tip drop-down list found in the "Help" theme of the Property List. You can either:

  • Choose an existing help tip. un nom d'infobulle existante. The help tip must have been previously specified in the Help tips editor of 4D. 
  • Enter the help message directly in the area. This allows you to take advantage of XLIFF architecture. You can enter an XLIFF reference here in order to display a message in the application language (for more information about XLIFF, refer to MissingRef.You can also use 4D references (see Using references in static text).

The message you select or enter will appear as a help tip for the field or object selected in the form.

To delete the association of a help tip with the selected object, choose None in the Property List.

This property is available for Alpha or Text type fields or variables in forms. This property keeps the selection visible within the object after it has lost the focus. This makes it easier to implement interfaces that allow the text style to be modified (see Multi-style (Rich text area)).

 
PROPERTIES 

Product: 4D
Theme: Properties for active objects