RetrieveStart event
Description
Occurs when the retrieval for the DataWindow or DataStore
is about to begin.
PowerBuilder event information
Event ID: pbm_dwnretrievestart
Web ActiveX event information
Event name: beforeRetrieve
Return Values
Set the return code to affect the outcome of the event:
-
0 Continue processing
-
1 Do not perform the retrieval
-
2 Do not reset the rows and buffers before
retrieving data
For information on setting the return code in a particular
environment, see “About return values for
DataWindow events”.
Usage
A return code of 2 prevents previously retrieved data from
being cleared, allowing the current retrieval process to append
new rows to the old data.
Obsolete methods in PowerBuilder
Instead of calling SetActionCode, use the RETURN statement
with a return code instead.
Examples
This statement in the RetrieveStart event prevents
a reset from taking place (rows will be added to the end of the
previously retrieved rows):
1 |
RETURN 2 |
This statement in the RetrieveStart event aborts
the retrieval:
1 |
RETURN 1 |
This code allows rows to be retrieved only when a
user has an ID between 101 and 200 inclusive (the ID was stored
in the instance variable il_id_number when the
user started the application); all other IDs cannot retrieve rows:
1 |
CHOOSE CASE il_id_number |
1 |
CASE IS < 100 |
1 |
RETURN 1 |
1 |
1 |
CASE 101 to 200 |
1 |
RETURN 0 |
1 |
1 |
CASE IS > 200 |
1 |
RETURN 1 |
1 |
END CHOOSE |