skip to main content
OpenEdge Getting Started: Progress OpenEdge Studio
Working with the Sample Application : Working with the Order Tracking System
 
Working with the Order Tracking System
The Order Tracking System combines modules to answer the common business functions needed in an order tracking application. Using it, you can add, search for, and maintain particular customers and orders. You can also maintain the product catalog and warehouse inventory records.
Business scenario
The architecture of the SportsPro Order Tracking System reflects a possible solution to a realistic business problem. Imagine that you are the general manager of a growing sporting goods distribution company. You find that your sales people are spending too much time responding to customers’ inquiries about the status of existing orders and too little time generating new orders. Your solution is to institute an order tracking help desk to enter the new orders for the sales people and to field customer inquiries.
You start designing an application for users to quickly look up customer information. You want the application structured so the tasks that users need do most often are the easiest to accomplish. You determine that users most often need to:
*Enter new orders
*Search for a customer
*Enter a new customer
*Change customer information, such as an address or phone number
*Check inventory quantities
*Search for an order
*Check on the shipping status of an order as a whole
*Retrieve information about specific items that were ordered
*Modify lines in an order
After you know what tasks users will do with the application, you know what information they will need. From that, you create a database that contains the information you need to query for the tasks. Once you have your database, you can begin the development phases.
To begin examining the Order Tracking System, click the Order Tracking button from the SportsPro main window. The main window of the Order Tracking System appears:
Note: You might encounter display problems with the application screens if you have your display set to large fonts and a resolution of 800x600. As a rule, if you use large or small fonts, you should use a higher resolution setting, such as 1024x768. If you do encounter display problems with the application screens, try changing your display settings.
The main window is a SmartWindow that is divided into three parts:
*Customer section
*Order section
*Order Line section
Table 2–11 describes the major objects used in the main window of the Order Tracking System.
 
Table 2–11: Components of the Order Tracking System main window
Object or filename
Object type
Function
worder.w
SmartWindow
Serves as a container for the other objects in the module
m_Item_Maintenance
Menu-item
Launches wmntitem.w, which is described in Table 2–7
m_Inventory_Trans
Menu-item
Launches winvtrans.w. (the Inventory Transfer section is described in Table 2–15)
m_Set_Application
_Language
Menu-item
Launches wlang.w (the Set Application Language section is described in Table 2–16)
dcust
SDO
Queries the Customer table to retrieve all customer records for the selected query
vcust
SDV
Displays the contents of several fields of the selected customer record
bfndcust
Button
Launches wfndcust.w, passing it the handle of dcust (wfndcust.w is described in Table 2–3)
bmntcust
Button
Launches wmntcust.w, passing it the handle of dcust (the Customer Maintenance section is described in Table 2–12)
dorder
SDO
Queries the Order table to retrieve all order records for the selected query
dordlne
SDO
Queries the OrderLine table to retrieve all order line records for the selected query
vorder
SDV
Displays the contents of several fields from the Order and Salesrep tables for the selected order record
dsalesrep
SDO
Queries the Salesrep table to retrieve all sales rep records for the selected query
dynselect
SmartSelect
Allows the user to navigate through the records in dsalesrep
CtrlFrame
OCX
Provides navigation control for the order records
CtrlFrame-2
OCX
Provides navigation control for the order records
bcreord
Button
Launches wmntord.w, passing it the handles of dcust, dorder, and dordlne. (the Order Entry/Maintenance section is described in Table 2–13)
bfndord
Button
Launches wfndord2.w, passing it the handle of dorder (the Find Order section is described in Table 2–14)
bmntord
Button
Launches wmntord.w, passing it the handles of dcust, dorder, and dordlne. (the Order Entry/Maintenance section is described in Table 2–13)
folder
SmartFolder
Organizes the display of objects onto two logical pages, shown as the Browser and Detail tabs
bordlne2
SDB
Allows the user to select an order line record
vordlne
SDV
Displays the contents of several fields of the selected order line record
pnavico
SmartPanel
(navigation)
Controls navigation for the result set from vordlne
sports2000.hlp
Help Text File
Provides help text for the buttons in the main window of the sample application
Customer section
The Customer section of the Order Tracking System main window has an SDV that displays customer information. The Customer section has the following buttons:
*Find Customer — Opens a dialog box to search for customer information
*Maintain Customer — Opens a dialog box to modify customer information
Searching for customers
The Find Customer button in the Order Tracking System main window opens the Find Customer window. In this window, you can view information about all customers, or you can find customers and view information based on specific search criteria.
The Find Customer window is a nonmodal child window of the main window. As a result, you can move between the Find Customer window and the main window by clicking on either one.
You can search the Sports2000 database dynamically by specifying query criteria at run time. Customers selected by the dynamic query appear in the browser.
To search for a customer:
1. Click the Find Customer button. The Find Customer window appears:
2. Using the Customer selection list and buttons in the upper section of the window, build the following query in the editor:
Name BEGINS "B"
3. Click the Search button.
The SDB displays customer names that start with “B”. From this window, you view details about a selected customer. You can also use the Show All button to remove the query and to view all the customers.
4. Select a row in the browser and choose the Display Detail button. The Display Customer dialog box appears:
The Display Customer dialog is a child window of the Find Customer window. The Display Customer dialog has a SDV for displaying address and other information for the customer selected in the Find Customer window. To learn how to create this SDV, see Chapter 4, “Overview of SmartObject Technology.”
5. After viewing the information, close the windows and return to the Order Tracking System main window.
Note: Table 2–3 describes the important elements of these windows in detail.
Modifying customer information
The Maintain Customer button in the Order Tracking System main window opens the Maintain Customer window. This window uses an instance of the same SDV that you saw in the Find Customer window. In this instance, the SDV is locally configured to allow you to change the record. This window also uses a SDF on the Comments field to enable you to view and enter comments. There is also an instance of a dynamic SmartToolBar that you use to navigate, create, and maintain customer records.
The Maintain Customer window is a nonmodal child window of the main window. As a result, you can move between this window and the main window by clicking on either one.
To modify customer information:
1. Click the Maintain Customer button. The Maintain Customer window appears:
2. Experiment with entering and updating changes in a customer’s address, telephone number, contact, e‑mail, and fax information.
3. Close the window and return to the main window.
Table 2–12 describes the major objects in the Maintain Customer section of the Order Tracking System.
 
Table 2–12: Components of the Maintain Customer section
Object or filename
Object type
Function
wmntcust.w
SmartWindow
Serves as a container for the objects in the Customer Maintenance section of this module.
dcust
SDO
Queries the Customer table to retrieve all customer records for the selected query. When this section is launched, it accepts the handle for the instance of dorder in the Order Tracking System main window
Note: This module uses a handle passed in from the main window. This module does not run properly unless launched from the main window.
dyntoolbar
SmartToolBar
Enables the user to add, copy, delete, or save the current customer record
vcust2
SDV
Displays the contents of several fields of the selected customer record
stxtfld
SDF
Displays the Comments field in vcust2 in a Cut/Copy/Paste editor
Order section
The Order section of the Order Tracking System contains SmartObjects for querying, viewing, adding, and changing order information.
The Order section has the following buttons:
*Place New Order — Places new orders for a customer
*Find Order — Opens a dialog box to search for order information
*Maintain Order — Opens a dialog box to view, update, and delete orders
Placing new orders
The Place New Order button in the Order section opens the Order Entry / Maintenance window to create new orders.
The Order Entry / Maintenance window is a nonmodal child window of the main window. As a result, you can move between the Order Entry / Maintenance window and the main window by clicking on either one.
The Order / Entry Maintenance window has an SDV for viewing order information and a SmartFolder with two tabs. A SmartFolder is a SmartObject that organizes the display of information into logical groupings, usually presenting the most frequently needed information on the first tab. In this instance, you can view different levels of detail about the customer’s orders and the individual lines of an order by choosing different tabs.
To view order information and place a new order:
1. Click the Place New Order button. The Order Entry / Maintenance window appears:
The Order Header tab contains a SDV that displays information about the order currently shown in the Order section of the Order Tracking System main window. The Order Header tab also contains a Navigation panel and a record Update panel.
2. Choose the Order Lines tab to view information about the order’s line items:
This tab contains an SDV that displays information about the individual order lines in the current order.
3. Click the browse button next to the Item field. The Item Selection window appears:
The Item Selection window is a SmartSelect Browser window with a dynamic SDB for browsing item information.
4. Close the windows and return to the main window.
Table 2–13 describes the major objects in the Order Entry/Maintenance section of the Order Tracking System.
 
Table 2–13: Components of the Order Entry / Maintenance section
Object or filename
Object type
Function
wmntord
SmartWindow
Serves as a container for the objects in the Order Entry/Maintenance section of this module.
dcust
SDO
Queries the Customer table to retrieve all customer records for the selected query. When this module is launched, it accepts the handle for the instance of dcust in the Order Tracking System main window.
Note: This module uses a handle passed in from the main window. This module does not run properly unless launched from the main window.
dorder
SDO
Queries the Order table to retrieve all order records for the selected query. When this module is launched, it accepts the handle for the instance of dorder in the Order Tracking System main window.
Note: This module uses a handle passed in from the main window. This module does not run properly unless launched from the main window.
dordlne
SDO
Queries the OrderLine table to retrieve all order line records for the selected query. When this module is launched, it accepts the handle for the instance of dordlne in the Order Tracking System main window.
Note: This module uses a handle passed in from the main window. This module does not run properly unless launched from the main window.
vcust
SDV
Displays the contents of several fields of the selected customer record.
folder
SmartFolder
Organizes the display of objects onto two logical pages, shown as the Order Header and Order Lines tabs.
vorder
SDV
Displays the contents of several fields from the Order and Salesrep tables for the selected order record.
dsalesrep
SDO
Queries the Salesrep table to retrieve all sales rep records for the selected query.
dynselect
SmartSelect
Allows the user to navigate through the records in dsalesrep.
pnavlbl
SmartPanel
(navigation)
Allows the user to navigate through the current result set.
pupdsav
SmartPanel
(update)
Allows the user to add, change, or delete records.
vordlne2
SDV
Displays the contents of several fields of the selected order line record.
ditem
SDO
Queries the Item table to retrieve item records for vordlne2.
dynselect
SmartSelect
Allows the user to navigate through the records in ditem.
btCustomerDiscount
Button
Runs getcustdiscount.p. Reads the returned value and then runs the calculatePrice internal procedure.
getcustdiscount.p
Procedure file
Returns the discount from the Customer table.
btBulkDiscount
Button
Runs getbulkdiscount.p. Reads the returned value and then runs the calculatePrice internal procedure.
getbulkdiscount.p
Procedure file
Returns the minimum quantities needed to qualify for a discount for each item.
pnavlbl-2
SmartPanel
(navigation)
Allows the user to navigate a set of records in a SDO.
pupdsav-2
SmartPanel
(update)
Allows the user to add, change, or delete records.
Finding orders
The Find Order button in the Order section opens the Find Order window to view order information.
The Find Order window is a nonmodal child window that is called from the main window. As a result, you can move between the Find Order window and the main window by clicking on either one.
The Find Order window contains a SmartFilter and a dynamic browser. Use the SmartFilter to define criteria to search through the selected customer’s orders. You can define a search query based on the date ordered, the order number, the order status, the sales representative, and the shipped date. Use the selection list to control which fields are displayed in the dynamic browser.
To view order information using a dynamic query:
1. Click the Find Order button. The Find Order window appears:
Initially, the window displays all available orders for the selected customer. You can use the Order filter section to define new search criteria to limit the orders that appear. You use the Select Fields Displayed in Browser selection list to define which fields you want to have displayed in the dynamic browser.
2. Type 01/01/98 into the Shipped field and choose the Apply Filter button.
The browser now displays order information based on the shipped date you entered.
Note: The fields in the browser remain the same as those in the initial search.
3. From the Select Fields Displayed in Browser list, choose the following fields for the browser:
*CustNum
*OrderDate
*Ordernum
*OrderStatus
*SalesRep
*ShipDate
4. Click the Re‑display Browser button to display the new fields in the dynamic browser.
5. Close the window and return to the main window.
Table 2–14 describes the major objects in the Find Order section of the Order Tracking System.
 
Table 2–14: Components of the Find Order section 
Object or filename
Object type
Function
wfndord2.w
SmartWindow
Serves as a container for the other objects in Find Order section of this module.
dorder
SDO
Queries the Order table to retrieve all order records for the selected query. When this module is launched, it accepts the handle for the instance of dorder in the Order Tracking System main window.
Note: This module uses a handle passed in from the main window. This module does not run properly unless launched from the main window.
getnewfields.p
Procedure file
Runs during the initializeObject internal procedure to populate the seldspflds selection list.
dynfilter
SmartFilter
Enables the user to dynamically filter the records shown in the browser.
seldspflds
Selection-list
Lists the fields in the Order table that can be displayed in the browser.
BUTTON-2
Button
Creates a dynamic browser instance from the master file, adm2\dynbrowser.w, using information from the filter and selection list.
dynbrowser
SDB
Enables the user to browse a result set created dynamically from dorder and information from the filter and selection list.
Changing orders
The Maintain Order button in the Order section opens the Order / Entry Maintenance window. This is the same module that you examined in the “Placing new orders” section. There are two entry points for this module to allow for differences in the way orders are created and updated.
If your business rules include differences in how orders are entered and how they are maintained, you would code custom triggers on these buttons to enforce those rules. For example, if only field agents could enter orders, you would code the Order Entry button to be disabled for anyone who was not a field agent.
Order Line section
The Order Line section of the Order Tracking System main window contains a SmartFolder with two tabs. One tab has a SDB for viewing Order Lines. The other tab has an SDV for viewing details about the Order Line. The display of the tabs in the SDV is controlled using logical pages. See the “Building the Order Line section” section for more information about logical pages,
To view the tabs in the SmartFolder:
1. Choose the Browser tab and select a particular line of the order:
2. Choose the Detail tab to view the details of just that line of the order:
Menu items
Less commonly used modules of the Order Tracking System can be launched through menu options. The Order Tracking System has menu options for maintaining the product catalog, examining warehouse records, and setting the language in which the application displays.
To view the modules available from the menu:
1. Choose ViewItem Maintenance. The Item Maintenance window appears:
The Item Maintenance window is a SmartWindow with an SDB, an SDV, a Navigation SmartPanel, and an Update SmartPanel.
Note: Table 2–7 describes the important elements of this window.
2. After examining this window, close it and return to the main window.
3. Choose ViewInventory Transfers. The Inventory Transfer dialog box appears:
The Inventory Transfer dialog box is a SmartDialog that is a child of the main window. The Inventory Transfer dialog box displays inventory records from the database. The fill-in fields enable you to specify search criteria to narrow the records shown in the SDB.
Table 2–15 describes the major objects in the Inventory Transfer section of the Order Tracking System.
 
Table 2–15: Components of the Inventory Transfer section 
Object or filename
Object type
Function
winvtrans.w
SmartWindow
Serves as a container for the objects in the Inventory Transfer section of this module
dinvtrans
SDO
Queries the InventoryTrans table for inventory information
binvtrans
SDB
Enables the user to select an inventory record
btn-search
Button
Uses any values in the fill-in fields to replace the WHERE clause in dinvtrans
4. Close the dialog and return to the main window.
5. Choose System DefaultsSet Application Language. The Set Application Language window appears:
OpenEdge applications can be translated into many languages using the Translation Manager tool. This module enables each user to choose among the available translations for the application.
Table 2–16 describes the major objects in the Set Application Language section of the Order Tracking System.
 
Table 2–16: Components of the Set Application Language section  
Object or filename
Object type
Function
wlang.w
SmartWindow
Serves as a container for the objects in the Set Application Language section
SELECT-1
Selection-list
Lists the available languages in which the module can display—selecting a new language sets it as the current language, if you have it installed on your machine
6. Close all the open SportsPro application windows.
Now that you have worked with the sample application, you have a sense of how a user would interact with an application and the applications that can be built using the AppBuilder and the SmartObjects. For a better understanding of how to use the AppBuilder to assemble the sample application, see Chapter 3, “Assembling the Order Tracking System.”
For an overview of SmartObject technology and information on fabricating your own SmartObjects, see Chapter 4, “Overview of SmartObject Technology.”