Successive loading of ProDataSet data
- Last Updated: February 11, 2026
- 4 minute read
- OpenEdge
- Version 13.0
- Documentation
Successive loading of ProDataSet data
The following procedure updates your code, so that you can do an initial load of header information into a ProDataSet, let the user make a selection from those header rows, and then fill in detail for selected rows.
To update your code:
- To get started, copy the final version of dsOrderWinUpd.w from Update Data with ProDataSets to a new procedure called PickOrder.w.
-
Delete the
Ordertemp-table fill-ins from the window. -
Define a browse for
ttOrderwith the columnsOrderNum,CustNum,SalesRep, andOrderDate. Name the new browseOrderBrowse.Remember that you can do this in the AppBuilder by selecting the Temp-Tables dummy database in the query builder for the browse. Since you copied the procedure from the earlier one, it has all the same temp-table definitions.
-
Define new fill-ins called
iCustNum,daOrderDate, andcSalesRep. -
Make the initial value of
daOrderDateblank (using theUnknown value (?)) so that it does not display today's date by default.An easy way to get the fill-ins to inherit the attributes of the fields they represent in
ttOrderis to go through these steps for each one. - Select the fill-in from the Palette and drop it onto the design window.
-
Double-click on the fill-in to bring up its property
sheet. Choose the Database Field button:
-
From the Field Selector dialog box,
select the field from the Temp-Tables database
and
ttOrdertable, as shown:
-
Make the field's Control Type
Local Variable, as shown:
-
Set the Object name in the property
sheet to the variable name, such as
iCustNum.This creates a local variable definition with the same attributes for label, format, and so forth as the temp-table field, but does not actually define the fill-in as the temp-table field. This is because you will not use these fill-ins to display fields from the current
ttOrder, but rather to enter filter criteria for retrievingOrders through the ProDataSet.You will use these fill-ins to allow the user to filter
Orders by entering a value into one or more of the fields. The window procedure will request adsOrderProDataSet with all theOrders that satisfy the selection, and then allow the user to select anOrderand fetchOrderLinedetail for it. -
Remove all the commented-out code from the
CHOOSE trigger for BtnSave. Change the statement at the end that re-enablediOrderNum(which is no longer there) to re-enable the three filter fields after aSavehas been processed, as shown:/* Re-enable the filter fields to select another set of Orders. Also, set TRACKING-CHANGES back to TRUE to capture any further changes made to this Order. */ ASSIGN iCustNum:SENSITIVE IN FRAME dsFrame = TRUE daOrderDate:SENSITIVE IN FRAME dsFrame = TRUE cSalesRep:SENSITIVE IN FRAME dsFrame = TRUE SELF:SENSITIVE = FALSE TEMP-TABLE ttOline:TRACKING-CHANGES = TRUE. -
Change the
ROW-LEAVEtrigger code for theOlineBrowseto change the reference toiOrderNumto disable the three filter fields, in the same way as in Step 11:IF OlineBrowse:MODIFIED THEN ASSIGN INPUT BROWSE OlineBrowse {&ENABLED-FIELDS-IN-QUERY-OlineBrowse} /* Disable the Order Number until changes are saved. */ iCustNum:SENSITIVE IN FRAME dsFrame = FALSE daOrderDate:SENSITIVE IN FRAME dsFrame = FALSE cSalesRep:SENSITIVE IN FRAME dsFrame = FALSE BtnSave:SENSITIVE IN FRAME dsFrame = TRUE.At this point the window should look something like this:

Now you are ready to start writing the support logic to retrieve data into the window.
-
In the Definitions section, define
a handle to hold the procedure handle of the procedure that contains
the event logic and other support procedures for the data retrieval.
For example:
DEFINE VARIABLE hOrderProc AS HANDLE NO-UNDO. -
In the Main Block, add a statement to
kill this procedure when the window exits. For example:
ON CLOSE OF THIS-PROCEDURE DO: DELETE PROCEDURE hOrderProc. RUN disable_UI. END. -
Add a statement to start the procedure when the window
starts up. For example:
MAIN-BLOCK: DO ON ERROR UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK ON END-KEY UNDO MAIN-BLOCK, LEAVE MAIN-BLOCK: RUN enable_UI. RUN orderSupport.p PERSISTENT SET hOrderProc. . . .The support procedure can be based on the procedure OrderEvents.p that you created earlier.
- Copy OrderEvents.p to OrderSupport.p.
-
Remove the
INPUTparameter definitions from OrderSupport.p. -
Add variable definitions for a ProDataSet handle and
a string to hold selection criteria. For example:
DEFINE VARIABLE cSelection AS CHARACTER NO-UNDO. DEFINE VARIABLE hBuff AS HANDLE NO-UNDO. DEFINE VARIABLE hDataSet AS HANDLE NO-UNDO. DEFINE VARIABLE iBuff AS INTEGER NO-UNDO. -
Set the handle variable to the
dsOrderProDataSet handle and change theSET-CALLBACK-PROCEDUREreferences to the old input parameterphDataSetto behDataSet, as shown:hDataSet = DATASET dsOrder:HANDLE. hDataSet:SET-CALLBACK-PROCEDURE ("BEFORE-FILL", "preDataSetFill", THIS-PROCEDURE). . . .