The Customer List Form
The Customer List form displays when the user clicks the button next to the store number
field (the buttonEdit widget). The custlist.per form defines a typical 'zoom'
form with a filter field and record list where the user can pick an element to be used in a field of
the main form. Using this form, the user can scroll through the list to pick a store, or can enter
query criteria to filter the list prior to picking. The fields that make up the columns of the table
that display the list are defined as FORMONLY fields. When TYPE is
not defined, the default data type for FORMONLY fields is
CHAR.
Form custlist.per:
001 SCHEMA custdemo 
002 
003 LAYOUT
004 GRID
005 {
006 <g g1                                        >
007  Store name: [fc                     :fe   ]
008 <                                            >
009 <t t1                                        >
010   Id   Name                  City
011  [f01 |f02                  |f03            ]
012  [f01 |f02                  |f03            ]
013  [f01 |f02                  |f03            ]
014  [f01 |f02                  |f03            ]
015 <                                            >
016 }
017 END
018 END
019 
020 TABLES
021    customer 
022 END
023 
024 ATTRIBUTES
025 GROUP g1: TEXT="Filter";
026 EDIT fc = customer.store_name;
027 BUTTON fe: fetch, IMAGE="filter";
028 EDIT f01=FORMONLY.s_num;
029 EDIT f02=FORMONLY.s_name;
030 EDIT f03=FORMONLY.s_city;
031 END
032 
033 INSTRUCTIONS
034 SCREEN RECORD sa_cust (FORMONLY.*);
035 END
Note: 
- Line 
001defines the database schema to be used by this form. - Lines 
003thru018define aLAYOUTsection that describes the layout of the form.- Lines 
006thru008define aGROUPBOXwith thefcfield where the user can enter a search criteria, and thefebutton to trigger the query. - Lines 
009thru015define aTABLEthat will be used to display the result set of the query. 
 - Lines 
 - Lines 
020thru022define aTABLESsection to reference database schema tables. - Lines 
024thru031define anATTRIBUTESsection with the details of form fields.- Line 
026defines the query field with a reference to thecustomer.store_namedatabase column. This will implicitly define the data type of the field and the Query by Example input rules. - Line 
027defines theBUTTONthat will invoke the database query. - Lines 
028thru030define the columns of the table with theFORMONLYprefix. 
 - Line 
 - Lines 
033thru035define anINSTRUCTIONSsection to group item fields in a screen array.