For each CursorAdapter you have created or added to the Data Builder, you can and should create index tag definitions. You need certain required index tag definitions for CursorAdapters to make Related Forms, One-to-Many forms and Related Pages forms based on CursorAdapters work. You can also create index tag definitions for the Toolbar Order control.
We use the term “index tag definition” because what VPME needs in many cases is just the definition. An actual index on the tag definition may never be required. It depends on the functionality that’s needed. When CursorAdapter indexes are needed, VPM Enterprise creates them on the fly.
Tip: See the Required Indexes for CursorAdapters to learn what index tag definitions VPM Enterprise requires you to define. See Index Tags and Toolbar Order Control to learn more about the Tags Edit page and how to set up the Toolbar Order control. Use the Tags Edit page to create or modify index tag definitions for CursorAdapters.
Ø To create a new index tag definition for a CursorAdapter
1. Select CursorAdapter: Select the CursorAdapter on the Data Builder List page.
2. Tags: Expand the CursorAdapter entry in the Data Builder List and select the Tags node at the bottom of the expanded List. Click the New button. VPM Enterprise displays the Index Tags Edit page.
The List page lets you see and select from a list of index tags for a CursorAdapter. The Tags Edit page lets you navigate through, create and maintain index tag information for the selected CursorAdapter. The Tag list box at the top of the Edit page lets you select from the Tag definitions that have already been created for the CursorAdapter. When you close the Edit page by closing the Data Builder or returning to the List page, the entries you made on the Edit page are saved.
3. Tag Name: Enter a name for the index tag you are defining in the Tag Name box. You can enter up to 10 characters.
4. Description: Enter a description for the index tag definition in the Description box. You can enter up to 100 characters. The Description you enter is displayed in the Toolbar Order control when the CursorAdapter is the InitialSelectedAlias on a form you create from the VPME form classes.
5. Comments: Enter any comments you want about the index tag that you are defining.
6. Index Expr: Enter the index expression for the index tag definition in the Index Expr box. Follow the Visual FoxPro rules for creating index tag expressions. The Visual FoxPro Expression Builder is not available for CursorAdapters because a CursorAdapter is not a VFP table or view.
7. For Expression: If the index tag definition requires a FOR expression, enter it in the For Expr box.
8. Descending: Check the Descending check box if you want to have the index created in descending order whenever it is used in your application.
9. VPM Primary: Check the VPM Primary check box if the index tag is the primary key for the CursorAdapter.
10. Create in Form: Check the Create in Form check box if you want the index tag to be created by the Load event (through the CreateTagsInForm method) of a form that has the selected CursorAdapter in its Data Environment. If not checked, the index tag will be created by VPM Enterprise as needed.
Tip: If you check the Create in Form check box for a CursorAdapter’s index tag definitions, you can easily bypass the creation of the CursorAdapter’s index tags on a particular form. To bypass the creation of the CursorAdapter’s index tags in the Load event of a form, add the CursorAdapter’s alias to the comma-delimited list of aliases stored in the form property cDoNotCreateTagsInForm_Aliases.
11. Include in Order dialog: Check the Include in Order dialog check box if you want to include the index tag definition in the Toolbar Order control when a form that displays the CursorAdapter is run. Including the index tag definition in the list of index tags displayed by the Toolbar Order control will let users select the index tag definition’s order when a form that displays the CursorAdapter is run.
12. Include in Order dialog when active form is a Related Forms child form: Check this check box if you want to include the index tag definition in the Toolbar Order control when the form that displays the CursorAdapter is related to a parent form already on the desktop. See “Child CursorAdapter Indexes Used in Toolbar Order Control” in the “Required Indexes for CursorAdapters – Child CursorAdapter Indexes” section below to better understand the requirements for child CursorAdapter indexes.
13. Return to List: When you have finished entering the index tag definition, click the List page to save the definition and to return to the List page from which you can create another index tag for the CursorAdapter.