
Chapter 9
214
Update inventory in [ProductsRS] with [OrderDetailsRS] data
when [button] is clicked
This contract updated the inventory data in the Products recordset when an order
is fulfilled by clicking a button. This contract is intended to be used in conjuction
with an update contract on the order record. In other words, the page should
contain and Orders and OrderDetails recordset filtered on the OrderID so that
they are showing data for the same order. The order record would be updated as
fulfilled, then this contract would execute to update product inventory: namely
units in stock and units on order: to reflect the quantity of each product in the
order that was fulfilled.
This contract assumes an OrderDetails recordset filtered for a specific OrderID
containing a list of products that for a specific order. The contract then iterates
through the list of products in the OrderDetails recordset, gets each product ID
and the order quantity for that product, then looks up the product in the Products
recordset. Values for units in stock and units on order are then decremented by the
order quantity for each product.
This contract should be used in conjunction with the "Do not create [target] if the
quantity of any product in [OrderDetailsRS] exceeds stock levels in [ProductRS]"
contract to prevent updating an order that doesn't have sufficient stock levels to
fulfill it.
Parameters:
OrderDetailQtyCol is the column name of the OrderDetails recordset that
contains the order quantity for a product.
ProductIDCol_OrderDetails is the column name in the OrderDetailsRS that
holds the unique ID of the product.
ProductIDCol_Products is the column name in the ProductRS that holds the
unique ID of the product.
QtyOnOrderCol is the column name in the Products recordset that stores the
number of units on order.
UnitsInStockCol is the column name in the ProductRS that holds the number
of units in stock of the product.
RedirectAfterUpdate specifies whether the page will redirect after the update.
RedirectPage is the destination for redirecting if the 'RedirectAfterUpdate'
parameter is checked.
Participants:
OrderDetailsRS is the recordset containing a list of products and order
quantities for a given order.
ProductRS is the recordset containing product inventory data.
Button (image, button, any clickable element)
Summary of Contents for DRUMBEAT 2000 ECOMMERCE EDITION
Page 1: ...Users Guide macromedia DRUMBEAT 2000 eCOMMERCE EDITION ...
Page 6: ...Contents 6 ...
Page 12: ...Introduction 12 ...
Page 90: ...Chapter 2 90 ...
Page 110: ...Chapter 3 110 ...
Page 124: ...Chapter 5 124 ...
Page 142: ...Chapter 7 142 ...
Page 152: ...Chapter 8 152 ...
Page 236: ...Chapter 10 236 ...