Step 3: Collecting Transaction Values

In this section:

Goal

You now have a set of customer records—the CustInfo stack—to display so that the clerk can update them. You do this using a Winform.


Top of page

x
Methods: WINFORM and NEXT

After you select data source records, you can apply transaction values to update or delete these records. You also can add new records without performing any prior record selection.

There are two ways of collecting transaction values:

NEXT is an expanded version of the MODIFY command of the same name. Its primary role (selecting records) was described in Step 2. NEXT also replaces MODIFY's FIXFORM command.

WINFORM replaces the MODIFY CRTFORM command and provides a user interface that is more powerful and easier to use.


Top of page

x
Solution

You display a Winform named ShowCust that displays the CustInfo stack and enables the clerk to edit membership, address, and phone information in the stack. For information about designing and creating Winforms and a tutorial, see Tutorial: Painting a Procedure.

The Painter also adds a comment line which states

>> Generated Code Section

Do not add or edit any lines following the comment line. The Painter uses this section (from this line through the end of the procedure) for Maintain functions that it generates. (Maintain functions are often referred to more simply as functions, and are also known as cases.) It also uses this section for comments describing the properties and layout of the Winform, the Winform's triggers, and stack and field bindings. These comments document your application and are explained in Using the Winform Painter.

Note that if you have created your own set of application files, you do not see the additional comments after the comment line just described.

You can omit the comments from your Maintain procedure by selecting the Preferences option from the File menu in Winform Painter and then deselecting Pictorial View. In the interest of simplicity, as the comments do not affect the logic of the procedure, they are not shown in the following sample code.

Note that the Winform Painter changes the VideoTrk specification in the MAINTAIN FILE command to all uppercase.

The procedure now looks like this:

MAINTAIN FILE VIDEOTRK
FOR ALL NEXT CustID INTO CustInfo 
WHERE ExpDate GE 920601 AND ExpDate LE 920621; 
WINFORM SHOW ShowCust;
-* >> Generated Code Section.... 
.
.
. 
END

Try it now: If you have created your own set of application files, enter these additional commands into your Maintain procedure file.

The ShowCust Winform already has been created and is in the VIDTAPE1 WINFORMS file. You can view it after you run the application in Step 5: Issuing the Procedure.


Information Builders