Display the new fields in the window
- Last Updated: December 20, 2023
- 2 minute read
- OpenEdge
- Version 13.0
- Documentation
You finished h-BinCheck.p and you already made the change to h-OrderCalcs.p to run it.
To change the window procedure to accept the new OUTPUT parameters and display them:
- Add two more fill-in fields to the window and call them cWorstWH and cBestWH.
- Give them labels that describe them, such as These warehouses are unable to fill the order and This is the best US warehouse for the order.
- Go into their property sheets and make them Enabled but Read-Only, like the other fill-in fields. The default data type for fill-ins is CHARACTER, so you do not need to change that. You can expand the field width to allow more room to display the results.
- Change the
RUNstatement in theVALUE-CHANGEDtrigger to include the two newOUTPUTparameters to h-OrderCalcs.p, and to display them:DO: RUN h-OrderCalcs.p (INPUT Order.OrderNum, OUTPUT dTotalPrice, OUTPUT dTotalExt, OUTPUT cWorstWH, OUTPUT cBestWH). dAvgDisc = (dTotalPrice - dTotalExt) / dTotalPrice. DISPLAY dTotalPrice dTotalExt dAvgDisc cWorstWH cBestWH WITH FRAME CustQuery. END. - Run the window. You see values for the
Warehousesthat cannot supply theItemsfor theOrderat all and for theWarehousethat is the best source for most of theItems, if there is one:
The data in the Sports2020 database is not too imaginative, so the Cologne
Warehouse is almost always unable to supply Items
and the Northeast USA Warehouse is almost always the best one. But the
values are recalculated every time you select a different Customer or a
different Order.
You learned a great deal about how to construct complex procedures in ABL. Using the principles of block types, data access statements, and record buffer scoping, you can write procedures that express your application’s specialized business logic with a precision and conciseness not possible in any other programming language.