To populate a browse from the AppBuilder using a Freeform query:
  1. Open the AppBuilder and select File > New > Window to create a new window.
  2. In the Section Editor of the new window, select Definitions from the Section drop-down list, and write the code for the temp table definition. For example, to create a temp table named ttState using the State table from the Sports2020 database, write the following code:
    DEFINE TEMP-TABLE ttState LIKE State.
  3. From the Palette, select Browse, and drop it in the window.

    You are prompted to connect to a database to create the browse.

  4. In the Query Builder dialog box, select the Freeform Query button.
    Note: Select Freeform. Allow freeform editing of query. in the Progress Advisor dialog box if it appears, and click OK.
  5. From the Palette, select the Button object and drop it in the window.
  6. In the Section Editor of the Button object, select Triggers from the Section drop-down list, and write the following code for the CHOOSE event:
    DO:
      {&SELF-NAME}:SENSITIVE = FALSE.
      FOR EACH state :
        CREATE ttState.
        ASSIGN
          ttState.State = State.state 
          ttState.statename = state.statename 
          ttState.region = state.region. 
      END.
      OPEN QUERY <browse-object-name> FOR EACH ttState. 
    END.
    Note: The <browse-object-name> is the name of the browse that is displayed in the Object field on the AppBuilder toolbar. You can also provide a user-defined name to the browse in the Object field of the Property Sheet. The Property Sheet appears by double-clicking the browse object in the window.

    For more information on browse attributes, see Property Sheet for Browse.

  7. In the Section Editor of the Browse, select Triggers from the Section drop-down list, and write the code for the following events:
    1. OPEN_QUERY:
      OPEN QUERY <browse-object-name> FOR EACH ttState.
    2. DISPLAY:
      State StateName Region
  8. Save the window and select Compile > Run from the AppBuilder toolbar to execute the window.
  9. Click the Button object to populate the Browse on the window.

    The Browse object populates with data from the State table.

    Close the window to terminate the application.