Kbase 16326: Example Using the XFTR Advanced Query Filter (Version 8.1A)
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
Example Using the XFTR Advanced Query Filter (Version 8.1A)
This kbase gives an example of using the new filter feature of the
Advanced Query Features (XFTRS), new in version 8.1A. You would
use this feature if you wanted the end user to be able to
optionally enter a city name at run time, and have an
" AND city = x" clause added to the query. Programmers should
be aware that using a filter based on a non-indexed field (like
city) will mean that Progress cannot use an index to resolve the
query, EVEN IF THE END-USER DOES NOT SPECIFY A FILTER VALUE AT
RUN-TIME. This can significantly slow performance, so should be
use with discretion.
With that warning, this is how to use the filter feature to
add a filter for city to a customer Smart Browser:
1. Create a new Smart Browser with the basic query (e.g. FOR
EACH customer).
2. Go into the Section Editor. Click on List, and accept
XTRF - Advanced Query Options.
3. Select Filters. Click on the first row, where it says
"Filter Value".
4. Type in "city". In the Initial Value field, type ?.
(You can add more filters, for this example, only one is
created.)
5. When you are done inserting filter fields, click OK.
6. For the browser, click on properties, and add a WHERE
clause to the browser query:
(city = ? OR customer.city = city)
7. Make the browse frame bigger, and place a fill-in in the
browser, called fill-in-1.
8. Create a LEAVE trigger for the fill-in, as follows:
ON LEAVE OF fill-in-1 DO:
ASSIGN fill-in-1.
RUN set-attribute-list IN THIS-PROCEDURE
('city=' + fill-in-1).
RUN dispatch IN THIS-PROCEDURE ('open-query-cases':U).
END.
At run-time, when the user types something into fill-in-1,
the query will be re-opened with only the records that have a
value in the city field equal to the city entered by the end-user.
Note that the XFTR Filter dialog is adding variables and
get-attribute-list calls to adm-open-query-cases that will
make this query work.
Further reading: User Interface Developer's Guide, Version 8.1,
Appendix B.
Progress Software Technical Support Note # 16326