Was this helpful?
Column Specification--Defaults
The Defaults field allows you to control what happens when a user does not enter a value in the specified data column. It works in conjunction with the Nulls field specification.
You can enter standard defaults or user‑defined defaults.
How You Specify Standard Defaults
You can enter certain standard default instructions directly into the Defaults field, as described in the following table:
Nulls Field
Defaults Field
Results if User Does Not Enter Data
Yes
yes
Enters a null value in the data column.
Yes
no
Requires a user to enter data in this column. User can explicitly specify a null value. Any QBFor VIFRED form created from this table can have the Mandatory attribute set for this data column.
No
yes
Enters a default value as follows:
Numeric column = 0
Variable‑length character column = string of zero length
Fixed‑length character column = blanks
Date column = empty date
User cannot enter an explicit null value.
No
no
Requires a user to enter data in this column. User cannot enter a null value. Any QBFor VIFRED form that is created from this table can have the Mandatory attribute set for this data column.
Yes
null
Enters a null value in the data column.
No
null
Not allowed.
Yes
user
Enters the username of the runtime user in the data column if no value is explicitly specified. User can explicitly specify a null value.
No
user
Enters the username of the runtime user in the data column. User cannot enter an explicit null value.
Yes
value
Enters a user‑defined default value created with the EditDefaults operation.
No
value
Enters a user‑defined default value created with the EditDefaults operation.
How You Specify User-Defined Defaults
You can specify a user‑defined default entry for a data column, using the EditDefaults menu option on the Create a Table frame. A value is then entered in the specified data column if an end user does not enter a value for that column. You can specify a user‑defined default value for a column even if none of the other columns for the row have been filled in on the Create a Table frame.
To specify a user‑defined default value
1. In the Create a Table frame, place the cursor in the Defaults field for the row in the column specifications table field for which you want to define a default value.
2. Type the word, value.
3. Tab out of the field or choose the End operation.
The EditDefaults pop‑up window displays:
The pop‑up contains a scrollable default value window that is initially 23 characters wide and scrollable to 1500 characters. The DBMS limit for default values is 1000 characters; however, the extra space in the default window allows for dereferencing characters.
4. Type the default value for the data column. The value can be any valid entry that is compatible with the data type of the column, including today or now for a date column.
You can remove or change the user‑defined default value at any time. To remove a user‑defined default entirely, change the Defaults field entry to yes, no, user, or null, as appropriate. To change the user‑defined default, place the cursor in the Defaults field and choose the EditDefaults menu operation; then enter the new default value in the pop‑up frame.
The previous user‑defined default value is saved temporarily. To restore it, type value in the Defaults field.
Last modified date: 08/28/2024