There are no LOGICAL fields in the Customer and Order tables to display as toggle boxes, but you can add a variable to display as a toggle box instead.

To add a toggle box that lets the user change whether the fields with warehouse information are displayed at run time:
  1. Select the Toggle Box icon from the Palette.
  2. Click in the design window to the right of the Total Ext price field to drop the toggle box onto the window.
  3. Change the Object name to lShowWarehouse (starting with the letter l because it is a representation of a LOGICAL variable) and change the Label to Show Warehouse Info.
  4. Adjust the size of the toggle box to show the whole label.
  5. Go into the property sheet for the toggle box, click the Advanced button, and change its initial value from no to yes.
  6. Select the Edit Code icon and define this VALUE-CHANGED trigger for the field:
    DO:
      ASSIGN lShowWarehouse.
      IF lShowWarehouse THEN
        ASSIGN cWorstWH:HIDDEN = NO
        cBestWH:HIDDEN = NO.
      ELSE
        ASSIGN cWorstWH:HIDDEN = YES
        cBestWH:HIDDEN = YES. 
    END.

Remember that a field value entered on the screen does not get saved to the record buffer until it is assigned. Therefore, the trigger block has to start with an ASSIGN statement for the variable before you can refer to its value. Alternatively, you could query the SCREEN-VALUE attribute of the field without assigning it. When you reference the SCREEN-VALUE, however, the value is represented as a character string, even though it is not displayed that way, so you would have to explicitly compare the SCREEN-VALUE to YES or NO like this:

IF lShowWarehouse:SCREEN-VALUE = "YES" THEN . . .

By contrast, when you assign the value to its record buffer, you can refer to it as a LOGICAL so that it becomes in effect a one-field expression that evaluates to true or false:

IF lShowWarehouse THEN . . .

Your new trigger is setting the HIDDEN attribute of the two warehouse-related fields to true or false. When you run the procedure and click the toggle box, the fields appear and disappear:

Look at the code to define a toggle box

This is the DEFINE VARIABLE statement the AppBuilder generated to define this toggle box (you can see this code from the Code Preview window):

DEFINE VARIABLE lShowWarehouse AS LOGICAL INITIAL yes 
     LABEL "Show Warehouse Info" 
     VIEW-AS TOGGLE-BOX
     SIZE 26 BY .81 NO-UNDO.

The INITIAL value, LABEL, VIEW-AS type, and SIZE are all defined here. As with other fields, the toggle box is enabled not by syntax in the DEFINE VARIABLE statement, but because it is added to the ENABLE statement in enable_UI.