Index Tags and Toolbar Order Control

Tip: This section applies to tables, views and CursorAdapters.

Expand the Tags node under a table, view or CursorAdapter on the List page in the Data Builder to:

·       View information about a table’s index tags,

·       Create and modify index tag definitions for a view or CursorAdapter, and

·       Select the index tags to include in the VPME Toolbar Order control.

Selecting a tag item in the Tags list and clicking the Edit page displays index tag properties.

The Tag Edit page shows information about one index tag at a time and lets you enter index tag information.

The selected tag is shown in the Tag combo box at the top of the Edit page. The Tag combo box lets you change the current tag. You can also use the Prior and Next buttons to navigate through the tags.

Ø To set up the Tag Edit page for table,  view and CursorAdapter  indexes

You should do the following on the Tag Edit page for every application table, view or CursorAdapter for which you will create a form:

1.   Tag Description: Enter a description for each index tag that you want to display in the Toolbar Order control for the table, view or CursorAdapter.

2.   Comments: Enter comments you want to record about the tag in the Comments box. The comments you enter can be used to provide users of your application important information about the tag.

3.   VPM Primary: If the index tag is the primary key for the table, view or CursorAdapter, check the VPM Primary check box

Important: The most important item on the Tag Edit page is the VPM Primary check box. For every table, view or CursorAdapter in your application, be sure to (1) create an index tag for the primary key field(s) in the Table Designer and (2) check the VPM Primary check box for the primary key index tag. After you identify the primary key for a table or local view, VPM Enterprise will automatically prevent duplicate primary keys when a new or edited record is saved.

4.   Include in Order dialog: Check the Include in Order dialog check box for each index tag that you want to display in the Toolbar Order control when the form that displays the table, view or CursorAdapter is activated and is not related to any parent form already on the desktop.

5.   Include in Order dialog when active form is a Related Forms child form: Check this check box for each index tag that you want to display in the Toolbar Order control when the form that displays the table, view or CursorAdapter is activated and is related to a parent form already on the desktop. Every tag you check must begin with the foreign key field(s) in the child table, view or CursorAdapter that links the child records to the primary key field(s) in the child’s parent table, view or CursorAdapter.

Toolbar Order Control

The VPM Enterprise Form Toolbar provides an Order control (see Order) that lets users change the order of the records displayed on a form. The Order control lets users change the record order by selecting from a list of indexes. The Tag Edit page lets you choose which indexes to display in the list of indexes for the Toolbar Order control.

Special Case for Child Forms

The VPM Enterprise Related Forms engine (see What are Related Forms?) lets you display child forms in two ways:

·       As an independent form when the child form’s parent form is not on the desktop.

·       As a Related Form when the child form’s parent form is on the desktop. In this case, the records displayed on the child form are those related to the current record on the parent form.

Because you may want to offer different choices on the Order control based on whether a child form is displayed as an independent form or as a Related Form, the Tag Edit page lets you choose which indexes to display in each case.

Index Information

VPM Enterprise maintains a table of index definitions for every table, view and CursorAdapter in the Data Builder. VPM Enterprise stores this index information in an application’s SDATADDIT.DBF table.

This stored index information is needed to implement many features in a VPM Enterprise application, including the following features:

§  Reindex/Pack Tables Utility: VPM Enterprise adds a Reindex / Pack Tables Utility to each application. This utility allows users of your applications to recreate indexes if they become corrupt. The utility uses the index information stored in the Index table to recreate indexes. Users can also use the utility to pack tables to remove any records marked for deletion and to pack memo fields. See Reindex / Pack Tables Utility.

§  Order Control Dialog: The Toolbar Order control dialog displays user-friendly index descriptions to identify the indexes a user can select to determine the order of the records displayed on a form. The Order dialog retrieves the index descriptions from the Index table.

§  Related Forms: The VPM Enterprise Related Forms engine uses the index Information in the Index table to identify how tables, views and CursorAdapters are related.

GetDDIT Method

The GetDDIT method of the application object (_SCREEN.oApp) makes information stored in the Index Tags table (SDATADDIT.DBF) available.

Three parameters are passed to the method: database or CursorAdapter library name,  table, view or CursorAdapter name and tag name.

Once the method has been called and has returned a value of .T., the tag's record can be accessed through the properties of an object, _SCREEN.oApp.oDDITRecord. The property names are the same as the field names, and those properties contain the values from the SDATADDIT.DBF record for the tag.

More:

Generating Surrogate Primary Keys