Skip to content

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:

Rearranged Order View

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.

  1. From the Base Controls group on the Class Palette, drag and drop a Button control into the bottom left corner of the view.
  2. Change the label of the button to Print Order.
  3. Change its name to PrintBtn.
  4. Set its peAnchors property to anBottomLeft.

Currently, this button has no function; clicking it will do nothing. We will add functionality in the reporting section of this tutorial.

  1. From the DDO Explorer, drag and drop the OrderHeader.Order_Total field into the bottom right corner of the view.
  2. Change the size of the control to 13,60.
  3. Set its peAnchors property 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:

Complete Order View Layout

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.

Next Step

Creating Reports