User Guide
Chapter 9210
Show [image] based on availability from [recordset]
This contract is conceptually similar to the "Replace [token] in [target] with
product availability from [recordset]" contract, except that an 'in-stock' image is
shown when the product is in stock, otherwise, an 'out-of-stock' image is shown.
The contract assumes that the recordset contains the columns to store the units in
stock, the units on order and the reorder level. It dynamically calculates the
difference between the units in stock and the units on order and compares the
difference to the reorder level value. If the difference exceeds the reorder level, the
item is considered to be in stock, and an in-stock image set via a parameter is
shown. Otherwise, the item is considered out of stock, and an out-of-stock image
is shown. The paths for the images must be specified in the respective parameters
relative to the application directory; for instance, "media\instock.gif."
Parameters:
In-stock Image is the path relative to the application path for the image to be
displayed if an item is in stock.
Out-of-stock Image is the path relative to the application path for the image to
be displayed if an item is out of stock.
ReorderLevel Col is the name of the recordset column containing the reorder
level value
StockLevel Col is the name of the recordset column containing the current
number of items in stock
UnitsOnOrder Col is the name of the recordset column containing the current
number of items on order.
Participants:
Recordset
Image