Chris Bova
Summit Software Company
December 1999
Summary: Describes the new features included in Duwamish Books, Phase 3.5: VBA (4 printed pages) Discusses:
This tutorial provides a step-by-step guide through a typical usage of Duwamish Books, Phase 3.5: VBA. After performing this tutorial, you should have an understanding of the new features in Duwamish Books, Phase 3.5: VBA and how customization with VBA enhances the application.
Microsoft® Visual Basic® for Applications (VBA) can be used to customize the ordering process by customizing the business rules on the middle tier. For example, Phase 3.5 of Duwamish Books does not contain rules relating to what staff can order. Phase 3.5: VBA uses VBA to customize the ordering process and, in this example, restrict the size and value of orders.
In this article, we will:
The Order client is particularly important to Duwamish Books, Phase 3.5: VBA, because it is one of two client applications that use VBA-enabled methods on the BLL.
To place an order
Start the Duwamish application by running the Duwamish Launch Control, log on as employee Kevin Learner (User Name: "Kevin" and Password: "Motorcycle").
Note Kevin is used here as an example. Any user without administrator rights could be used in this part of the sample. Later the administrator account will be used to create VBA code behind the BLL InsertOrder method.
Note If you have any trouble using the Order client, consult the "Order Entry User Guide" in the Help file included with the downloadable application.
Notice that any employee can enter an order for any number of books. Duwamish Books places no restrictions on who can order what.
Fortunately for our hypothetical administrator, Duwamish Books, Phase 3.5: VBA comes with a sample customization that, among other things, prevents non-administrative users from purchasing more than one hundred books, or a thousand dollars worth of books, or more than fifty of any one book at a time. We'll import and install this customization project using the Modifier. Remember that you must be logged on as the administrator in order to use the Modifier, so you may need to log off and on again to change your identity. Launch the Modifier and make sure you are customizing the Order component. (The option buttons to the left of the Project Store View will allow you to change which component you are currently customizing.)
To install a customization project
For more information on authoring order customizations in the Modifier, consult the "Modifier User Guide."
Log in as Kevin one last time, return to the Order client, and try to repeat your order of ten thousand books. Your customization project will then block the processing of the order and gently admonish you for your spendthrift ways.
VBA can also be used to customize the performance model used for assessing members of staff who purchase books for the stores. The Buyer customization allows the VBA programmer to write a model that calculates a points-based scheme for buyers based on their activities during a given period. This can be based on various factors, such as the number of orders placed, the number of books purchased, or the number of unfulfilled orders.
Next, we will:
Gathering Employee Information with the Buyer Client
Log on to the Duwamish Books system as the administrator. The Buyer client application allows administrators and buyers to see information about outstanding purchase orders, book sales, and employee performance. These views can be navigated through the tabs. Under the "Outstanding POs" view you'll see a summary of purchase orders. The Performance tab will show you a range of information about different employees' purchasing activities, including the number of outstanding POs, their value, and a "Points" category that VBA can customize to rank your employees against each other. For now, the performance points are always zero because we didn't provide a customization that evaluates the performance points. As always, if you have trouble using the Buyer client, consult the "Buyer Client User Guide." When you are finished, close the Buyer client and return to the Duwamish Launch Control.
Duwamish Books, Phase 3.5: VBA also comes with sample customization that provides a sample performance point formula. This sample customization can be installed in a similar fashion as the sample customization for the ordering process.
To install a customization project
For more information on authoring buyer customizations in the Modifier, consult the "Modifier User Guide."