Consultor Eletrônico



Kbase P101733: How to create two BROWSE objects in the AppBuilder against the same table using TEMP-TABLES or BUFF
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/29/2008
Status: Verified

GOAL:

4GL/ABL: How to create two BROWSE objects in the AppBuilder against the same table using TEMP-TABLES or BUFFERS.

GOAL:

How open two queries against the same table with the PRESELECT option without generating error 1672.

FACT(s) (Environment):

Windows
Progress 8.x
Progress 9.x
OpenEdge 10.x

FIX:

Use TEMP-TABLEs or BUFFERs for one or both BROWSE objects.
A. Using two TEMP-TABLES:
1. Start the AppBuilder.
2. Connect to the Sports2000 demo database.
3. Create a new Window:
File ->New -> Window
4. Define two TEMP-TABLEs like the Customer Table:
Tools -> Procedure Settings ->
TT -> Add -> Customer (Type table name: ttCustomer1) -> OK.
Add -> Customer (Type table name: ttCustomer2) -> OK.
5. Define first BROWSE against the first TEMP-TABLE ttCustomer1:
Menu -> Browse -> Temp-Tables -> ttCustomer1 -> Fields -> Add -> CustNum, Name, City, Country -> OK -> OK.
6. Define second BROWSE against the second TEMP-TABLE ttCustomer2:
Menu -> Browse -> Temp-Tables -> ttCustomer2 -> Fields -> Add -> CustNum, Name, Balance, CreditLimit -> OK -> OK.
7. Drop a BUTTON object on the window.
8. Put the following code behind the CHOOSE event of the button to populate the TEMP-TABLEs and open the two BROWSE queries:
DO:
/* Populate the temp-tables */
FOR EACH customer NO-LOCK:
CREATE ttCustomer1.
CREATE ttCustomer2.
BUFFER-COPY Customer TO ttCustomer1.
BUFFER-COPY Customer TO ttCustomer2.
END.
/* Open the two queries */
OPEN QUERY BROWSE-1 PRESELECT EACH ttCustomer1.
OPEN QUERY BROWSE-2 PRESELECT EACH ttCustomer2.
END.
9. Save the window.
10. Run the window.
11. CHOOSE the button and observe that the two browsers populate successfully.
A. Using two BUFFERS:
1. Start the AppBuilder.
2. Connect to the Sports2000 demo database.
3. Create a new Window:
File ->New -> Window
4. Define two BUFFERS for the Customer Table:
Tools -> Procedure Settings ->
TT -> Add -> Customer ->Click 'Buffer' Radio Button (Type table name: bCustomer1) -> OK
Add -> Customer ->Click 'Buffer' Radio Button (Type table name: bCustomer2) -> OK
5. Define first BROWSE against the first BUFFER bCustomer1:
Menu -> Browse -> Temp-Tables -> bCustomer1 -> Fields -> Add -> CustNum, Name, City, Country -> OK -> OK.
6. Define second BROWSE against the second BUFFER bCustomer2:
Menu -> Browse -> Temp-Tables -> bCustomer2 -> Fields -> Add -> CustNum, Name, Balance, CreditLimit -> OK -> OK.
7. Drop a BUTTON object on the window.
8. Put the following code behind the CHOOSE event of the button to open the two BROWSE queries:
DO:

/* Open the two queries with PRESELECT option */
DO:
OPEN QUERY BROWSE-1 PRESELECT EACH bCustomer1.
OPEN QUERY BROWSE-2 PRESELECT EACH bCustomer2.
END.
9. Save the window.
10. Run the window.
11. CHOOSE the button and observe that the two browsers populate successfully.