home page . bottom return
Dependent Validation Lists
by
Andy Dimbleby and Peter May

T he Valid Choice List is a boffo function which presents the user with a selectable list of valid entries to a field (instead of showing the Assisted Entry Panel.) The list contains the acceptable validation patterns.
When we rewrote the Information/Management system at Grattan plc, the UK's third largest home shopping company, we wanted to use Valid Choice Lists. As well as stand alone lists we fully exploited dependent lists.
In this article we will share with you how to

Valid Choice Lists

It is not widely known that a field can display different lists depending on the data value previously entered in another field.

For example, imagine we have two fields, 1 and 2.



1. Problem type ...... ________   (s-word 0C09 - Assisted entry panel BLG6PTYP)
2. Key item affected.. ________  (s-word 0CBF - Assisted entry panel BLG6KIAF)

If the user enters into Field 1 the data HARDWARE, then the following valid choice list is shown when the user selects Field 2 .
   | ____________________________________________________________________________________
   |  ===>                                                                            |
   |                                                                                  | 
   |  BLGLVSEL                   VALIDATION DATA                         LINE 1 OF 27 | 
   |                                                                                  | 
   |  USE....Select one from the list of valid entries for this field.                | 
   |                                                     VALIDATION RECORD: HARDWARE  |
   |                                                                                  | 
   |     1.  PC                            PC HARDWARE PROBLEMS                       |
   |     2.  PRINTER                       PRINTER PROBLEMS                           |
   |     3.  SCREEN                        SCREEN FAULTS                              |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  | 
   |   Line Cmds:  S=Select                                                           | 
   |   Type DOWN or UP to scroll the panel, or type BACK to exit the panel.           | 
   |                                                                                  | 
   |__________________________________________________________________________________| 

But if the value entered in Field 1 is SOFTWARE, then the following validations for Field 2 are shown
    ____________________________________________________________________________________
   |  ===>                                                                            |
   |                                                                                  | 
   |  BLGLVSEL                   VALIDATION DATA                         LINE 1 OF 27 | 
   |                                                                                  | 
   |  USE....Select one from the list of valid entries for this field.                | 
   |                                                     VALIDATION RECORD: SOFTWARE  |
   |                                                                                  | 
   |     1.  GRAPHICS                      GRAPHIC     PROBLEMS                       |
   |     2.  SPREADSH                      SPREADSHEET PRPBLEMS                       |
   |     3.  WORDPRO                       WORDPROCESSING PROBLEMS                    |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  | 
   |   Line Cmds:  S=Select                                                           | 
   |   Type DOWN or UP to scroll the panel, or type BACK to exit the panel.           | 
   |                                                                                  | 
   |__________________________________________________________________________________| 

And if the value in Field 1 is NETWORK, the validations for Field 2 are
   ____________________________________________________________________________________
   |  ===>                                                                            |
   |                                                                                  | 
   |  BLGLVSEL                   VALIDATION DATA                         LINE 1 OF 27 | 
   |                                                                                  | 
   |  USE....Select one from the list of valid entries for this field.                | 
   |                                                     VALIDATION RECORD: NETWORK   |
   |                                                                                  | 
   |     1.  CONTROL                       CONTROLLER  PROBLEMS                       |
   |     2.  LAN                           NETWORK IN BUILDING                        |
   |     3.  WAN                           NETWORK OUTSIDE BUILDING                   |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  |
   |                                                                                  | 
   |   Line Cmds:  S=Select                                                           | 
   |   Type DOWN or UP to scroll the panel, or type BACK to exit the panel.           | 
   |                                                                                  | 
   |__________________________________________________________________________________| 


So Field 2 has different validation patterns depending on the value previously entered in Field 1.

How to make a field dependent

To make one field dependent on another is simple. Just modify the Assisted Entry Panel control information for the dependent field. Enter the s-word index that identifies the field that contains you want this one to depend on in field 3 of BLM8CU5B.
| ____________________________________________________________________________________
|                                                                                     |
|                                                                                     |
| BLM8CU5B       STRUCTURED WORD AND VALIDATION COLLECTION       PANEL: BLG6KIAF      |
|                                                                                     |
| Enter collection control data; cursor placement or input line entry allowed.        | 
|                                                                                     |
|                                                                                     |                                                                                     |
|                                                                                     |
|                                                                                     |
| 1. Structured word index......... 0CBF     Structured word.. XIM0IC000D             |
| 2. Collect from caller........... NO_      Word acronym..... IM = KEY ITEM AF       |
|                                                                                     |
| 3. Validation record s-word index 0C09     Structured word.. XIMGCT0000             |
| 4. Validation record name........ ________                                          |
| 5. Validation data s-word index.. ____     Structured word..                        | 
|                                                                                     |
|     When you finish, type END to save or CANCEL to discard any changes.             |
|                                                                                     |
| ____________________________________________________________________________________|


When a user enters data into this field an attempt will be made to display a validation record with an RNID/. which is the same the data already in the record with the s-word 0C09. So if field 1 contains the data HARDWARE then the validation list for field 2 will be part of a record with the record ID RNID/HARDWARE.

Validation records should be created for every value allowed in field 1. If a validation record is not found then the Assisted Entry Panel will be shown.

Keeping fields in step

What happens is the user decides to enter data in Field 2 before Field 1? Because there is no data in Field 1 the appropriate validation record cannot be found, so the assisted entry panel is shown.

Or suppose the user enters data in the correct order, then changes their mind and enters a new value in Field 1. Now the value in Field 2 does not match field 1.

One method of keeping the two fields in step is to force completion of field 2 every time field 1 is updated.

Modify the panel flow control information in Field 1 assisted entry panel to go directly to to the Field 2 assisted entry panel





| ____________________________________________________________________________________
|
|
| BLM8CU5A                     PANEL FLOW UPDATE                 PANEL: BLG6PTYP
|
| Enter panel flow control data; cursor placement or input line entry allowed.
|
|
|
|                  1. Create target............ BLG6KIAF
|                  2. Inquiry target........... ________
|                  3. Return to caller......... NO_
|                  4. Dialog end............... NO_
|                  5. Force SRC generate end... NO_
|                  6. Program exit symbol...... ________
|
|
|
|     When you finish, type END to save or CANCEL to discard any changes.
| ____________________________________________________________________________________

This is the assisted entry panel control onformation for Field 1; instead of returning to the calling panel it will go directly to the assisted entry panel for field 2, and that will display the dependent valid choice list.

To prevent users entering data in Field 2 before completeing Field 1, change Field 2 to be a display field. Every time Field 1 is changed, the user is afterwards taken to the appropriate dependent list for Field 2

Multiple dependent fields

As seen above, a dependent field shows a validation record with the RNID/. that matches the data in the independent field. But what if you wanted more than one field to be dependent but for each to have different validation lists?

 

For example, imagine we have three fields, 1, 2 and three.

1. Problem type ...... ________  (Assisted entry panel BLG6PTYP)
2. Key item affected.. ________  (Assisted entry panel BLG6KIAF)
3. Cause code......... ________  (Assisted entry panel BLG600CC)