HP 3000 Manuals

Using the Module Details Screen [ HP ALLBASE/4GL Developer Self-Paced Training Guide ] MPE/iX 5.0 Documentation


HP ALLBASE/4GL Developer Self-Paced Training Guide

Using the Module Details Screen 

You use the module details screen to specify which fields from the record
layout are included in the resultant screen.  You can also specify which
fields in the resultant screen are linked with secondary files.  Access
to the module details screen, which is shown below, is only possible
after you have committed the module builder screen.

[]
Module Details Screen Screen Description To create a screen, the module builder takes the fields from the record layout and creates corresponding screen fields. With the module details screen, you can change, delete, insert, and add fields to the resultant screen. You can define whether a field is for display or input, and whether it is a field that always requires an entry. You can also alter the field's on screen label, which defaults to the text in the short description field of the field specification. You also use the module details screen to link a field in the resultant screen with a secondary file field. To build this feature into your application you first specify to which file the field is linked. Then if necessary, you specify the record layout and index field for this file. In the resultant module, there is an after function associated with the link field. This after function looks through the index field of the secondary file for a record with data matching that in the link field. This is the matching record. You can then use this match to display data from other fields of the matching record on the resultant screen, or validate the entered data against data in the index field of the secondary file. The secondary file records act the same way as a validation table. You can only create one-to-one links between a screen field and a secondary file. This means you can link each screen field to only one secondary file, and each secondary file can only be linked to one screen field. You can only access one record at a time in the secondary file. However you can link up to twenty fields with different secondary files. To enter the field values for order_no: Field Entry Explanation --------------------------------------------------------------------------------------- Sequence Number Accept the default. When you commit the Sequence Number field, HP ALLBASE/4GL displays the details for the first screen field, order_no. The module builder always includes the index field you specified as the first field in the resultant screen. As this field is used for record retrieval, its function within the resultant screen cannot be modified. Consequently you can only edit the On Screen Label field. Action Accept the default. This action code works in the same manner you encountered when creating logic blocks. On Screen Label Order Number This field defaults to the short description field on the field specification screen. This is the label text displayed next to the order_no input field on the resultant screen. To complete and commit the screen: 1. Press the Commit Data function key. To enter the field values for Officer Name: Field Entry Explanation --------------------------------------------------------------------------------------- Sequence Number Accept the default. Notice that after you commit the Sequence Number field, HP ALLBASE/4GL fills the File, Field Spec. Name, and On Screen Label fields with default values. This screen sequence is defined by the record layout order. HP ALLBASE/4GL uses the record layout for the screen field sequence if you specify Y at the Include All Fields prompt on the module builder screen. Action Accept the default. File Accept the default. The screen field's primary movement field is in the file buffer specified in this field. Field Spec. Name Accept the default. The data in this field completes specification of the primary movement field for the screen field. On Screen Label Officer Name To complete and commit the screen: 1. Press the Commit Data function key to complete the specification of details for the officer_name screen field. Linking a Field to a Secondary File Now link the product_no field to a secondary file. To link a field to a secondary file: Field Entry Explanation --------------------------------------------------------------------------------------- Sequence Number Accept the default. Accept the default values for the Action, File and Field Spec. Name fields. On Screen Label Product Number Type I This indicates that product_no is an input field, not a display field. Required Y This indicates that product_no is a required field. If the user leaves the field blank, an error message will be displayed. Link Y This tells the module builder to create an after function to link the data entered by the user into the Product Number field with data in the secondary file named below. Validate Y This tells the module builder to include, in the after function, logic to validate the data entered into the screen field with the index field of the secondary file. It means that the user cannot enter a product number into the order file if the product number doesn't exist in the product file. Link To: File product This is the name of the secondary file linked to the product_no field. Link To: Record This field is For KSAM based applications and HP bypassed for HP TurboIMAGE/iX based applications, accept ALLBASE/SQL tables. the default value product_rcrd Link To: Index Accept the default. The link after function searches through the index field of the secondary file. It retrieves the record where data in the index field matches that entered in the link field. To complete and commit the screen: 1. Press the Commit Data function key. Inserting a Display Field This field shows the description of the product. It displays the description field of the product record matching the data entered in the link field, product_no. Any fields displaying data from the secondary file must appear on the screen after the link field, that is, the display fields must have a higher sequence number. This is because the appropriate record must be retrieved before other fields can be displayed. In this application, the product number must be entered before the description of the correct product can be displayed. To insert a display field: Field Entry Explanation --------------------------------------------------------------------------------------- Sequence Number 4 This is the number of the next field in the resultant screen field sequence. This displays the next field from the order file, which is quantity. Action I This means that you wish to insert a field before the quantity field, which is currently field number 4. When you press Return, module builder alters the defaults to the product file and default record layout. File Accept the default. Field Spec. Name description On Screen Label Description Notice that because this is a field from a secondary file, it automatically defaults to a display field. You cannot specify any links to this field. To complete the field: 1. Press the Commit Data function key. To complete other field labels: 1. Use the same procedure that you used to enter the details of screen fields 1 and 2 to enter the details of the screen fields listed below. Sequence No. Field Spec. Name On Screen Label 5 quantity Order Quantity 6 unit_measure Unit 7 cost $ 8 order_date Ordered 9 delivery_date Delivered


MPE/iX 5.0 Documentation