Progress
Language Reference


DELETE-RESULT-LIST-ENTRY( ) Method

Deletes the current row of a query’s result list.

Return Type: LOGICAL

Applies To: Browse, Query Object Handle

SYNTAX
DELETE-RESULT-LIST-ENTRY ( ) 

For the browse, DELETE-RESULT-LIST-ENTRY() solves the following problem: Suppose you create a browse with a primary table and a secondary table, and in the primary table, the key to the secondary table changes. Progress never displays the new secondary table because the result list entry contains the rowid of the original secondary table.

When you use DELETE-RESULT-LIST-ENTRY() together with CREATE-RESULT-LIST-ENTRY(), you can update the result list entry and display the modified row without having to reopen the query.

For example, suppose you create a browse with customer.name, customer.salesrep, and salesrep.repname (from the Sports database). Then, in one record of the browse, you change customer.salesrep from “bbb” to “dkp.”

Without using DELETE-RESULT-LIST-ENTRY(), the secondary record remains “bbb” until the query is reopened.

The following code fragment uses DELETE-RESULT-LIST-ENTRY() and CREATE-RESULT-LIST-ENTRY() to display the modified secondary record:

ON ROW-LEAVE OF my-brow DO:
    DEFINE VAR num AS INTEGER.
    DEFINE VAR ok AS LOGICAL.
    IF customer.sales-rep:MODIFIED = TRUE THEN DO:
        num = customer.cust-num.
        ok = my-brow:DELETE-RESULT-LIST-ENTRY().
        /* DELETE-RESULT-LIST-ENTRY() disconnects recs from rec bufs */
        /* so reread customer and salesrep records */
        FIND customer WHERE customer.cust-num EQ Num.
        FIND salesrep WHERE salesrep.sales-rep EQ
            customer.sales-rep:SCREEN-VALUE.
        /* Create new result list entry */ 
        /* with "new" secondary table’s rowid */
        ok = my-brow:CREATE-RESULT-LIST-ENTRY().
        /* Update viewport */
        DISPLAY salesrep.rep-name WITH BROWSE my-brow.
    END.
END. 

NOTE: During this operation, the query pointer must not move.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095