Find Existing Reservations Dialog

Previous Next

This scenario is part of Actions Example 11: Window with Separate Search Dialog. To get a dialog that can act as a permanent toolbar to assist in queries in a Reservations window:

1.Create a new subclass of the Dialog Box class, rename it to "FindExistingReservations".
2.In the Controls Group, insert a text box with prompt: Destination, and set the Related Column property to:

TOUR.DESTINATION

A lookup button appears that calls a lookup window for Tours.

3.Insert a text box with prompt: Customer Name, and set the Related Column property to:

PERSON.FAMILY_NAME

4.Rename the OK and Cancel buttons to "Find" and "Close" respectively, and reposition them if required.
5.Open the Object Activator for the Action property of the Find button, remove the dialog-ok() action, and compose this method call script:

myReservations.QueryDefine()

myReservations.query.destination(Variables.Text_Box_1() )

myReservations.query.family_name(Variables.Text_Box_2() )

myReservations.QueryExecute()

 

In this script, "myReservations" is a user-defined property of the dialog class. It represents a window object, not a string. Here are the steps for writing this script:

1.Make sure the FindExistingReservations dialog is selected in the Object Browser tree view (top-left).
2.In the Methods pane, click the Properties tab page, and click New.
3.In the New Property dialog, specify Name = myReservations, Type = Reservations, accept 1 as the Argument Position, and click OK.
Because you specified a new property with an object-like type, a new node for myReservations is added to the Object Browser pane.
4.Back in the Object Activator, click the myReservations object in the Object Browser, then select the QueryDefine() method, and then click Add.
5.In the Object Browser pane, select the "myReservations.query.destination" column object, and then click Add.
6.Select the empty parameter node of the newly added method call, select the "Variables.Text_Box_1" object, and then click Set.
7.Follow the same steps to produce the method call passing the customer name.
8.Finally, add the "myReservations.QueryExecute() call and click OK to exit the Object Activator.

Continue with Reservations Window.