A zoom allows a user to “drill down” to a lower level of detail for a given record. A zoom control includes a zoom field and a zoom pointer. The following illustration shows a typical zoom control:
The Salesperson zoom field in the sample application’s Lead Maintenance window allows the user to zoom to the Salesperson Maintenance window, where the user can view the entire salesperson record. The zoom field must provide a key value (Salesperson ID) to display a salesperson record.
Always allow a zoom operation, regardless of whether the zoom field is empty or not. If the field is empty, open the maintenance form with no record displayed. |
Be sure to review the following points when adding a zoom field to your window:
To add a zoom field to a window in your application, display the window’s layout and complete the following steps.
Create a local push button field and add it to the window layout. Position this field directly over the prompt for the field on which you’re zooming. Set the following field properties:
Visible |
False |
Zoom |
True |
Attach a change script to the zoom button similar to the following example. This example zooms from the Lead Maintenance window’s ‘Salesperson ID’ field to the RM_Salesperson form. If the user entered an existing salesperson ID in the Lead Maintenance window, the script sets the ‘Salesperson ID’ field in the RM_Salesperson window. Issuing a run script statement for that field displays the associated record in that window.
open form RM_Salesperson; 'Salesperson ID' of window RM_Salesperson of form RM_Salesperson = 'Salesperson ID' of window 'Lead Maintenance'; {Check to see whether an existing ID was entered.} if not empty('Salesperson ID') then {The user zoomed when an existing ID was displayed, so retrieve the record.} run script 'Salesperson ID' of window RM_Salesperson of form RM_Salesperson; end if;