Release 10.1A: OpenEdge Getting Started:
Progress OpenEdge Studio

> ## 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 a 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. Choose 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 a SDV that displays information about the individual order lines in the current order.

> 3. Choose 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. Choose 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, select the following fields for the browser:

> - CustNum
> - OrderDate
> - Ordernum
> - OrderStatus
> - SalesRep
> - ShipDate
> 4. Choose 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.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095