Creating and Setting Up Local Views - Overview

The Data Builder can store a great deal of information about a view and its fields. You may decide not to set up all the information the Data Builder stores for every view and every field. Certainly, you don’t have to set up all field properties before you start using a view to build Application Objects. Most field properties can be entered and changed later.

However, there are certain view and field properties that you should set up as a minimum before you start building Application Objects. If you don’t set up those view and field properties, VPM Enterprise won’t be able to trigger all its automatic features that help you build Application Objects. 

Tip: You can, of course, set up all view and field properties before you start creating Application Objects. In fact, you are encouraged to do so. It’s probably more productive and efficient to use the Data Builder to set up all view and field properties at one time than to do it piecemeal.

The minimum set up required for a local view in the VPM Enterprise Data Builder is described below. These steps point out the view and field properties that you should set up before you build an Application Object that uses the view.

Ø To create and set up a local view in the Data Builder

1.   Select Database: On the Data Builder List page select Local Views node under the Database that you want to contain the view.

2.   Create or Add: Click the New button to create a new view or click the Add button to find existing views. VPM Enterprise displays appropriate dialogs to either create or add a view. See Creating Local Views - Details and Adding Views for the details on how to create and add local views using the Data Builder.

3.   Creating New Views: If you are creating a new view, VPME will display the VFP View Designer. Create the view in the View Designer. Be sure to make the view updatable if you will be using it for a data entry form.

·       First Field From Parent Table – Source Table: When you are creating a view from more than one table, the first field in the view should come from the main, or parent, table. VPME will then identify the "source table" of the view as the table containing the first field in the view. Identifying the source table of a view is necessary at various points in a VPME application. For example, it is needed when determining the relationship between a view and another table, view or CursorAdapter.

·       Create View filters: If the new view is a parent or child view or if you will be using the VPME SQL Find Form with the view, you must set up special filter parameters for the view. See Find – SQL.

4.   Adding Existing Views: If you’re adding existing views, you can add more than one view at a time. In fact, you can add all the views in a database at once.

Add Tip: Be sure that the views you add conform to the same requirements described in this chapter for the new views you create.

5.   Required Indexes: For the view you’ve created or added, you can and should create index tag definitions using the Tags Edit page. See Defining Indexes for Views to learn how to create index tag definitions for views. You need to create index tag definitions for views to make related forms, one-to-many forms and related pages forms based on views work. You can also create index tag definitions for the Toolbar Order control.

    Tip: You must create the indexes described in Required Indexes for Views on page 166.

6.   View Properties: Click a view’s Edit page in the Data Builder..

·       Description: Enter a Description for the view.

See Setting View Properties for the details on using the Data Builder to set up view properties.

7.   Primary Key: Identify the view’s primary key index tag. Expand the view’s item list and select the primary key index tag. Click the Edit page. Check the VPM Primary checkbox on the Edit page to designate the tag as the primary key index tag.

Primary Key: The primary key is the field or combination of fields that uniquely identifies each record in a view.

8.   Update Field Info: If the Data Builder Field Properties, Integrity, Code and Help settings for the view will be the same or substantially the same as those of the view’s associated tables, you can save yourself considerable set up time by letting VPM Enterprise copy the Field Properties, Integrity, Code and Help settings from the Data Builder records of the associated tables to the Data Builder records of the view. With the view selected on the List page, click the Edit page and then click the Update Field Info button.

9.   Referential Integrity:  If the view contains a foreign key matching the primary key of another table, view or CursorAdapter, select the field in the treeview list and click the Edit page. Click the Integrity page and set up Referential Integrity validation for the field(s) in the foreign key. VPM Enterprise uses your Referential Integrity validation setup to determine how tables, views and CursorAdapters are related to each other in an application.  See Referential Integrity for the details.

10. Field Label & Grid Captions: For each view field that will appear on a form or report, select the Edit - Properties page and enter a descriptive label in the Description (Short) and Description (Long) text boxes. Enter the label you want in a grid header in the Description (Short) text box. Enter the descriptive label that you want to appear next to the field on a form in the Description (Long) text box.

Tip: If you run the Update Field Info utility, the Referential Integrity and Field Label  and Grid Captions will be entered for the view if they were previously entered for the view’s associated tables.

More:

Creating Local Views - Details