Previous Next

DELETE-RESULT-LIST-ENTRY( ) method
Deletes the current row of a query’s result list.
Return type:
Applies to:
 
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. The AVM 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 VARIABLE num AS INTEGER NO-UNDO.
  DEFINE VARIABLE ok  AS LOGICAL NO-UNDO.
 
  IF Customer.SalesRep:MODIFIED THEN DO:
    num = Customer.CustNum.
    ok  = my-brow:DELETE-RESULT-LIST-ENTRY().
 
    /* DELETE-RESULT-LIST-ENTRY() disconnects recs from rec bufs, so re-read
       Customer and SalesRep records */
    FIND Customer WHERE Customer.CustNum EQ num.
    FIND SalesRep WHERE Salesrep.SalesRep EQ Customer.SalesRep:SCREEN-VALUE.
    /* Create new result list entry with "new" secondary table’s rowid */
    ok = my-brow:CREATE-RESULT-LIST-ENTRY().
    /* Update viewport */
    DISPLAY SalesRep.RepName WITH BROWSE my-brow.
  END.
END. /* ROW-LEAVE OF my-brow */
Note:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.