BROWSE.VIEWQUERIED()
Syntax
<BROWSE> as P = BROWSE.VIEWQUERIED( Browse_Name as C [, Filter_Expn as C [, Order_Expn as C [, IsBaseQuery as L ]]] )
|
Argument |
Description |
|
Browse_Name |
The name of the browse to open. In the case where there are duplicate browse names in the database, you can qualify the browse name with the table name using this syntax: Browse Name@Table Name. For example, if a database has a browse called "Customers" for the "Current_Customers" and the "Past_Customers" tables, you can specify the browse as: "Customers@Current_Customers", or "Customers@Past_Customers". |
|
Filter_Expn |
Optional. Default = all records, subject to any filter defined in the browse layout itself. A character filter expression that evaluates to a logical value and selects records from the table. |
|
Order_Expn |
Optional. Default = record order. A character order expression that sorts selected records. |
| IsBaseQuery | (V8 only) The default value for this property is .T. Specify if the query is a 'base query' or not. See 'Understanding Base Query' below. |
Description
BROWSE.VIEWQUERIED()opens Browse_Name, displaying selected and ordered records, and returns the < BROWSE > object pointer to the browse window.
Note : You cannot open
a browse window as a modal dialog box. If you wish to have a
modal browse window, design a form with an embedded browse, and then open
the form as a modal dialog.
Understanding 'Base Query'
When you design a Browse layout you can go to the Browse, Properties dialog and and specify a filter expression for the browse. When the browse is opened, only records that satisfy the filter will be shown. This filter is referred to as a 'base query' because it is always applied regardless of what additional filter the user might add to the browse after the browse has been opened (by using Query Genie, Query by expression, etc.). If the user applies some filter to the browse and then clicks the 'show all' button to remove the filter that he added, the base query is still in place. The user cannot remove the base query. (You will notice that when a base query has been defined, the Select Index/Query command is disabled, and the button to change the search key on the Find by Key dialog is also disabled because enabling them would allow the user to remove the base query.).
So, for example, if a browse has a base query of 'State = "MA" ' and the user defines a query to search for ' Lastname = "Smith" ', the actual query is ' State = "MA" .and. Lastname = "Smith" '. When the user clicks the 'Show All' button, the 'State = "MA"' query is still in place.
When the BROWSE.VIEWQUERIED() method is used with IsBaseQuery set to its default vlaue of .t. the filter that is specified becomes the browse's new base query and it cannot be removed by the user.
If IsBaseQuery is set to .f., then the browse is opened showing just the records that satisfy the filter condition, but the filter is not a base query and the user can click the 'Show All' button to remove the filter.
Note. After a browse has been opened, the <browse>.BaseQueryRun() method can be used to specify a different base query for the browse.
Supported By
Alpha Five Version 5 and Above
Limitations
Desktop applications only.
See Also