Customizing the Order Entry View
Now you are going to customize the Order Entry View in the DataFlex Studio. In the process, you will learn how to add your own custom code to add features to the view that the wizard did not provide.
Normally, you would make these kinds of changes in iterations. You would make a change, test it, correct it as needed, and re-test until it is working as desired. When this is complete, you would move on to the next change. As you work through these modifications, study them one at a time.
Completing the View's Layout
Let's start by rearranging the controls in the view to make the layout a bit nicer.
Arrange the controls in the view until they look more or less like this:

Extend the bottom edge of the view to create room for one additional row of controls. Here, you will place a button to print orders and a dbForm to display each order's total amount.
- From the Base Controls group on the Class Palette, drag and drop a
Buttoncontrol into the bottom left corner of the view. - Change the
labelof the button to Print Order. - Change its
nameto PrintBtn. - Set its
peAnchorsproperty to anBottomLeft.
Currently, this button has no function; clicking it will do nothing. We will add functionality in the reporting section of this tutorial.
- From the DDO Explorer, drag and drop the
OrderHeader.Order_Totalfield into the bottom right corner of the view. - Change the
sizeof the control to 13,60. - Set its
peAnchorsproperty to anBottomRight.
This concludes the layout of the view; all the controls have been placed onto the view and are in their final location. When you are done, the view should look more or less like this:

Next, you will add some custom code and study the code created for you by the wizard to understand what the code in this view does.
Disabling Entry in the Terms Combo-Form
We want to make the Terms combo-form object a non-edit list. Two types of combo forms are supported: a drop-down list and a drop-down-edit list. The edit list, which is the default, allows users to enter directly into the form or to select a value from the combo list. We want to only allow selection from the combo list. Setting the object's Entry_State to False does this. Do so using the Properties window.