This article explains how to use the STOCKSIZE and STOCKCUTS functions in product formulas to add support for stock cut-down products.
In an effort to make working with cut-down products easier, SWCS now support two functions, STOCKSIZE and STOCKCUTS. These functions make it easy to write formulas that will determine the stock product to use based on color, finished width and height and also to determine how much to
cut off, left and right side, of a stock product.
To use these functions you must first setup a data file that contains the stock product information. This data file must be supplied alongside your product file.
The data file is a tab-delimited text file with the following columns:
STK0001 WHITE 10 15 5 99
STK0002 WHITE 16 20 5 59
STK0003 WHITE 16 20 60 99
Use the STOCKSIZE function to lookup and return the stock item to use based on the color, width and height. The STOCKSIZE function will scan the data file and return the name of the stock item that best fits the color, width and height restrictions. The syntax for using this function is
STOCKSIZE(<color>|<width>|<height>|<datafile>)
where
<color> is the color too lookup. This is usually a reference to an option in the product where the
user chooses the color. For example [Color].
<width> is the width to lookup. This is usually a reference to the finished width option in the
product. For example [Finished Width Dec].
<height> is the height to lookup. This is usually a reference to the height option in the product.
For example [Height].
<datafile> is the name of the data file that contains the stock lookup data. This is the file name with extension. For example mydata.txt. Do not include the full path to the file and don't use quotes around the name.
STOCKSIZE([Color]|[Finished Width Dec]|[Height]|stockdata.txt)
Notes
Use the STOCKCUTS function to calculate the amount to cut off the left and/or right side of the stock item. The data used by the STOCKCUTS function is the same as that used by the STOCKSIZE function. The syntax for using this function is
Notes