Required Fields

Some fields must always have entries when a record is saved on a form. We call such fields “required fields”.

When a record is saved on a VPME form, the SaveRecord method of the Data Handler object runs the EmptyRequiredFields method of the Data Handler object. The EmptyRequiredFields method determines which fields are required fields and which required fields are empty or contain a null value. If any required fields are empty or null, values must be entered into the required fields before the record can be saved.

You can specify that a field is a required field (a) by setting the field’s Integrity Option to “On” on the Integrity page in the Data Builder or (b) by entering the field into the cNotBlankFields property of a form.

Tip – cNotBlankFields Overrides Integrity Option On: If a form’s cNotBlankFields property is empty when a record is saved, the form’s required fields are those whose Integrity Option is set to “On”. However, if the cNotBlankFields property contains field entries, the Data Builder Integrity Option setting is ignored and only the specific fields listed in the cNotBlankFields property are the form’s required fields. In other words, you can use entries in the cNotBlankFields property of a form to override the Data Builder required field designations.

Required fields must not be null or empty. If a required field is found to be null or empty as a record is being saved, a dialog appears that lists the fields that must have entries. The fields are listed in the order in which they are entered into the cNotBlankFields property. Upon clicking OK on this dialog, the user is returned to the form to make entries into the required fields.

cNotBlankFields Property

The cNotBlankFields form property lets you identify fields at the form level that are required to have entries when a record is saved on a form. When you create a form, you can enter a comma delimited list of fields into this property that require an entry when a record is saved. If a field is not in the InitialSelectedAlias table, view or CursorAdapter, put the table, view or CursorAdapter alias in front of the field followed by a period (e.g., tablealias.fieldname).


Leaving and Returning to a Form While Editing