Creating, Modifying, and Troubleshooting Fields

In Notes/Domino, fields are used to enter, modify, and display data stored in items. (Item is the technical name for a discrete data element stored in a Notes document.) Fields can be used in forms, subforms, and layout regions and layers and can be either single-use fields or shared fields. (Each is explained in the following sections.) Three key criteria must be specified when creating fields: the field name, the data type of the field, and the field type.

Naming Fields

Each field on a form must have a unique name. If you are using subforms in a form, this rule also applies. In addition to using a unique name for each field, you should keep the following points in mind:

  • Field names cannot exceed 32 characters in length.

  • Field names cannot contain spaces. You can use underscores (_) instead.

  • Field names should not begin with a dollar sign ($), because this character is usually reserved for special Notes system fields.

  • Field names cannot begin with a number (1–9).

  • Field names cannot contain the ampersand symbol (&).

Field Data Types

The Notes database architecture supports a wide range of data types for fields. The data type of a field specifies the type of data that can be stored in a field. The various data types supported in Domino 6 are explained in Table 4.12.

Table 4.12. Notes Data Types
TypeDescription
TextText fields store up to 15K of textual data, can be displayed in views, and have no fixed field length.
Date/TimeDate/Time fields store and display time and date information in any number of formats, the default being MM/DD/YY HH:MM:SS (internally, Domino stores times in seconds). Valid dates range from 1/1/0001 through 12/31/9999. Entering a two-digit year between 00 and 49 assumes the century starts in the year 2000. Entering two-digit years between 50 and 99 assumes the century starting in the year 1900. You can force users to enter a four-digit year in the field by selecting Require User to Enter Four Digit Years in the On Input field in the Field Properties box. If you want to display a calendar control for users, select Calendar/Time Control. The Calendar works only in Notes clients, not on the Web.
TimezoneTimezone fields display a drop-down list of all available time zones.
NumberNumber fields are used to store numeric data, including numerals 0–9, the plus (+) and minus (-) signs, decimal point, and scientific notation. Number fields can be formatted in one of the four following ways: Decimal, Percent, Scientific, or Currency. Each is briefly explained in the following list:
  • Decimal— Stores and displays numbers with a fixed number of decimal places specified by the developer. A number field can store up to eight non-zero decimal digits without loss of precision.

  • Percent— Stores and displays numeric values as a percentage.

  • Scientific— Stores and displays numeric values using exponential notation.

  • Currency— Stores and displays numeric values with the currency symbol specified by the developer. The default format is the American dollar sign ($).

  • Blank number fields are stored as an empty string (“”). To make a number field always store a numeric value, use a default formula of 0.

Dialog listDialog list enables users to select the correct value(s) from a list of acceptable choices. The developer can determine whether the list should be mutually exclusive. The user can press Enter or click the Entry Helper button (the little arrow) to see all the choices at once, press the space bar to display choices one at a time, or type a letter to display the first choice beginning with that letter. Keep in mind that you cannot use a Dialog list in a layout region.
Check boxCheck box fields enable users to select the correct value(s) from a list of acceptable choices, which are not mutually exclusive. Each choice in the list is displayed with a box users click on to select.
Radio buttonRadio button fields enable users to select the correct value from a list of acceptable choices, which are mutually exclusive. Each choice is displayed with a button that users click to select.
List boxList box fields enable users to select the correct value(s) from a scrolling fixed-size list of acceptable choices. The developer can determine whether the list should be mutually exclusive.
Combo boxCombo box fields enable users to select the correct value from a drop-down list of mutually exclusive acceptable choices.
Rich textRich-text fields can be used to store large amounts of text and formatted text, and can be used for embedding or attaching objects. There is no practical size restriction (1GB) on the data placed in the field, as long as the database and disk drive can store the data. Rich text fields can be used anywhere except in a layout region, and their contents cannot be displayed in a view.
Rich text liteRich text lite fields are not as open-ended as a regular rich text field. They have a drop-down list that enables you to specify the type of data the user can put in the field. Any attempt to insert or paste an element not listed displays an error message. This field type is new to Domino 6.
AuthorsAuthors fields enable users with Author access to edit documents if they are named in the Authors field. It is important to remember that Authors fields do not override the ACL, but merely refine it.
NamesNames fields can be used to display user and/or server names in abbreviated format without the components associated with a fully qualified hierarchical name.
ReadersReaders fields can be used to limit access to specific documents by explicitly listing the users/groups who can read documents. Like Authors fields, Readers fields refine the ACL; they do not override it. If no Readers fields exist in a document, anyone with access to the database can read the document.
PasswordPassword fields are special type of text fields that helps to maintain privacy by displaying each character entered as an asterisk on the screen. Remember that the contents of a password field are not secure, and are visible in the Document properties box from the Notes client.
FormulaFormula fields have a special purpose: They are used to populate a subscription list, which works in conjunction with the Subscription feature in the Headlines.nsf database.
ColorColor fields display a color picker, which enables the user to select a color and return an RGB value.

Expect to see at least one question about the new Rich text lite field.


The field type is another key setting involved in adding fields to a form. The Designer supports four field types:

  • Computed— Value is the result of a formula and is stored in the document. It is recomputed when the document is opened, refreshed, or saved.

  • Computed for Display— Value is the result of a calculation, but the value is not stored in the document. It is recomputed when the document is created, opened, refreshed, or saved.

  • Computed When Composed— Value is the result of a calculation, and the value is stored in the document.

  • Editable— Value is entered by the user and is stored in the document. A default formula can be used to populate the field when a document is created, and input translations and field validation formulas can be used to manipulate data when the document is saved and to validate data when it is refreshed.

Design Considerations When Adding Fields

Before you add fields to a form, it is prudent to consider the following:

  • The type of data to be stored in the field

  • The method the user will use to interact with the field, such as combo box versus radio button versus text field

  • The most logical position for the field on the form

  • The need for security on the field

  • The need to conditionally hide the field

  • The presentation of the field, including font size, face, and color

Creating Single-Use Fields

A single-use field can be used only in the form or subform that hosts it. To create a single-use field, follow these steps:

1.
Open the form or subform in which you want to add the field.

2.
Position the cursor to the spot where you want the field to appear.

3.
Choose Create, Field, which inserts a new unnamed field and opens the Field properties box to the Info tab (see Figure 4.11).

Figure 4.11. The Info tab on the Field properties box enables you to define the basic properties of a field.


4.
On the Info tab, enter the following information:

  • Enter a name for the field in the Name field (keep the naming conventions mentioned previously in mind).

  • Select the data type of the field (defined in Table 4.12).

  • Select the type of the field: Editable, Computed When Composed, Computed for Display, or Computed.

  • If the field can store multiple values, select the Allow Multiple Values check box.

  • If the field is computed, and you would like its value to be computed after the form's validation formula has fired, click the Compute After Validation check box.

  • Choose the type of appearance the field should have, either Notes Style or Native OS Style. If you select Native OS Style, be sure to set the height and width properties.

  • Set the field's tab order and, if you want the field to get the default focus (cursor is positioned in this field first), click the Give Field Initial (Default) Focus check box.

5.
Select the Control tab (2nd tab) to choose the display options for the field. The choices presented on this tab vary widely, depending on the type of field you have elected to create. Be sure to check the settings for the field you are creating.

6.
Select the Advanced tab (third tab) and, if necessary, enter a help description. If the field is set to display multi-values, configure the multi-values options. The font settings for a field are fairly self-explanatory and are not covered in detail. You can also set security options such as signing and encryption here.

7.
Select the Fonts tab if you want to format the font of the field. The font settings for a field are pretty much self-explanatory and are not covered in detail.

8.
Select the Paragraph Alignment tab to control the alignment of the field within its paragraph. The alignment settings for a field are pretty much self-explanatory and are not covered in detail.

9.
Select the Hide When Options tab to control the conditions under which the field is to be visible. By default, a field is always visible. Be sure to configure the hide-when settings if the new field you are creating should not be visible at all times.

10.
Select the Field Extra HTML tab to enter HTML-specific attributes for the field, such as class and style, which allows developers to use cascading style sheets.

11.
Save the form or subform.

12.
Test the form to ensure that the field works as expected.

Modifying Single-Use Fields

To modify a single-use field, follow these steps:

1.
Open the form or subform in which you want to add the field.

2.
Position the cursor to the spot where you want the field to appear.

3.
Double-click the field you want to edit.

4.
Follow the steps outlined in the preceding section, “Creating Single-Use Fields.”

Troubleshooting Single-Use Fields

The following is a list of tips to help you in troubleshooting single-use fields:

  • Check the field properties to ensure the field is set to the proper data type.

  • Ensure that the type of field is set correctly. For example, if the field value should be saved as an item in the document, but is not, be sure that you have not set the field to be Computed For Display.

  • If you are planning to store multiple values in a field, be sure that the field has the multi-values property enabled.

  • If the field is of type keywords, but you are not getting the correct values in the list, check the formula being used to generate the list.

  • If the field is computed and the computations are based on other fields in the form, be sure to check the order of the fields. Remember that in Notes, fields are computed from left to right and top to bottom.

Using Field Help and Hints

Field Help and Field Hints provide users assistance when filling out a form. Field Help creates a one-line row at the bottom of the form that displays custom messages that tell the user how to use the field. Field Hints appear as a default value in the field that goes away when the user enters the field.

Field help text and Field hint text work only on the Notes client, not on the Web.


Creating Field Help and Field Hints

To add either Field Help or Field Hints to a field, follow these steps:

1.
Open the form that contains fields to which you want to add field help and/or field hints.

2.
Select a field on the form.

3.
Double-click the field, which opens the field properties box.

4.
Click the Advanced tab (propeller beanie).

5.
Enter Field Help text in the Field Help field or enter Field Hint text in the Field Hint field.

6.
Save and test the form.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.35.229