Kbase 17665: How to get additional info into a browser without a join
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  5/10/1998 |
|
How to get additional info into a browser without a join
INTRODUCTION
============
This knoledgebase entry discusses how to use a row-display trigger
on a browser to get additional information from a secondary table
into the browser without needing a join.
PROCEDURAL APPROACH
===================
The following example is a browser for the customer table which
displays the salesrep for the customer and the salesrep's name which
is from the salesrep table.
1) Define a freeform query to be used for the browser with the
following triggers:
ON OPEN_QUERY OF BROWSE-1
OPEN QUERY {&SELF-NAME} FOR EACH Customer NO-LOCK
ON DISPLAY OF BROWSE-1
Customer.Cust-Num
Customer.Name
Customer.Sales-Rep
repname
2) Define a local variable in the Definitions secion of the
window:
DEFINE VAR repname LIKE Salesrep.Rep-Name
3) Create a row-display trigger for the browser with the following:
ON ROW-DISPLAY OF BROWSE-1
DO:
FIND Salesrep OF Customer NO-LOCK NO-ERROR.
IF AVAIL Salesrep THEN repname = Salesrep.Rep-name.
END.
This will display the salesrep name from the salesrep table in the
customer browser without having to join the customer and salesrep
tables together in the browse query.
Progress Software Technical Support Note # 17665