FlagInventory
Use this component to determine if any items on the order form are out of stock.
Intended use: Order Processing pipeline, Inventory stage.
Configuration Values
You can determine how the FlagInventory component deals with back orders by setting component properties. Use the following boxes on the Flag Inventory tab of the Component Properties dialog box to determine this information.
Box | Description |
Disallow Backorder | If selected, indicates back orders are not permitted. The component will add a message to the _Purchase _Errors list when there is a back order. |
Values Read
The FlagInventory component reads the following values from the indicated dictionaries.
Key | Dictionary | Description |
item._product_in_stock |
Order | Optional. The quantity of this item in stock. |
item.quantity |
Order | The quantity of the item ordered. |
MessageManager |
Context | Dynamic. A reference to a MessageManager object. Used to retrieve the out-of-stock constant (pur _out_of_stock ) in case of an error. Used only if the DisallowBackorder box is selected. |
Values Written
The FlagInventory component writes the following values to the Order dictionary.
Key | Description |
item._inventory_backorder |
The amount back ordered to fulfill the order for this item. |
_Purchase_Errors |
Dynamic. Error messages are written to this SimpleList object only if the Disallow Backorder box is selected. |
Errors
The component writes error messages to the _Purchase
_Errors
collection. The component uses a MessageManager object to retrieve user warning message text.
Constant | Condition |
pur_out_of_stock |
An item in the order is out of stock. |
Remarks
When this component runs, it loops through the item list in the order form, checking the value of the _product
_in
_stock
field for each item. If that value is zero (0), the component sets the _inventory
_backorder
key to the quantity ordered to indicate the shortage. In addition, if the Disallow Backorder box is selected, the component writes an out-of-stock message to the _Purchase_Errors
list of the order form.
The _product
_in
_stock
value corresponds to the in_stock column in the products database table.
This component verifies that none of the order items have the _product
_in
_stock
value, which corresponds to the in_stock column in the products database table, set to zero (0). If any item does have this field set to zero, the FlagInventory component sets the_inventory
_backorder
key to the quantity ordered (indicating the shortage). If such a shortage occurs and the Disallow Backorder box is selected, the FlagInventory component will generate a pur
_out
_of
_stock
error in the _Purchase
_Errors
collection. This component interacts with a manual inventory control process; the product database must be updated to reflect the actual stock on hand.
If you include the FlagInventory component in your pipeline, the order form must contain a column named _product_in_stock
. This value is placed in the order form by the query that is executed in the Product Information stage, usually by the QueryProdInfoADO component or the QueryCatalogInfo component. Usually, this value is selected from a database column named in_stock. You can also place _product_in_stock
column on the order form by manipulating the query.
This component interacts with a manual inventory control process. The product database must be updated to reflect the actual stock on hand.