Partilhar via


InventorySkusDataSet

For the latest version of Commerce Server 2007 Help, see the Microsoft Web site.

The InventorySkusDataSet class contains all the attributes for an inventory SKU. You can access the DataRowCollection of the dataset’s data table by using the InventorySkus property. You can access each row in the collection by using the properties of the InventorySkusDataSet..::.InventorySku class.

The following table contains the strongly typed properties in this dataset.

Property

Description

Backorderable

Gets or sets a Boolean value that specifies whether this product can be back-ordered.

BackorderAvailabilityDate

Gets or sets a DateTime value that specifies when the back-ordered SKU will be available for shipping. This date is stored in UTC time.

BackorderedQuantity

Gets a decimal value that specifies the quantity of this SKU that has been back-ordered. This is a computed property.

BackorderLimit

Gets or sets a decimal value beyond which this SKU cannot be back-ordered.

ExcessOnHandQuantity

Gets or sets the OnHandQuantity value above which the SKU is considered to have excess inventory.

InventoryCatalogName

Gets a string that contains the name of the inventory catalog for this SKU.

LastModified

Gets a DateTime value that specifies when the product was last modified. This date is stored in UTC time.

LastRestocked

Gets or sets a DateTime value that specifies when the SKU was last restocked. This date is stored in UTC time.

Memo

Gets or sets a string that contains user-defined information.

Oid

Gets a string value that is intended for internal use only.

OnHandQuantity

Gets or sets a decimal value that specifies the on-hand quantity for the SKU.

Preorderable

Gets or sets a Boolean value that specifies whether this product can be preordered.

PreorderAvailabilityDate

Gets or sets a DateTime value that specifies when the preordered SKU will be available for shipping. This date is stored in UTC time.

PreorderedQuantity

Gets a decimal value that specifies the amount that has been preordered until this point. This is a computed property.

PreorderLimit

Gets or sets a decimal value that specifies the quantity above which preorders should not be taken.

ProductCatalogName

Gets a string that contains the name of the product catalog that contains this product.

ProductId

Gets a string that specifies the identifier of this product.

ReorderPoint

Gets or sets the OnHandQuantity value below which the product inventory should be replenished.

Status

Gets or sets an integer that specifies the current stock status for this SKU. This value corresponds to one of the values of the StockStatus class.

The possible values are as follows:

  • 0 - Disabled

  • 1 - Enabled

  • 2 - Ignored

StockOutThreshold

Gets or sets a decimal value that the SKU quantity must exceed to be considered in stock.

TargetQuantity

Gets or sets a decimal value that specifies the desired amount of inventory for this SKU.

Timestamp

Gets a binary value that specifies the last time this row was updated. This value is for internal use only.

UnitOfMeasure

Gets or sets a string that specifies the unit of measure for the quantity properties.

VariantId

Gets a string that contains the identifier for the variant.

Constraints

The InventorySkusDataSet class does not define any constraints.

Using the InventorySkusDataSet Class

The following example demonstrates how to access the properties of the InventorySkusDataSet class.

public static void UseDataset(CatalogContext catalogContext, string inventoryCatalogName)
{
    // Iterate through the inventory SKUs in the Catalog 
    // System to access attributes.
    // Get an inventory catalog.
    InventoryCatalog inventoryCatalog = catalogContext.InventoryContext.GetInventoryCatalog(inventoryCatalogName);
    // Get a collection of all SKUs in the Catalog System.
    InventorySkuCollection skuCollection = inventoryCatalog.GetSkus();
    // Get the dataset for the collection.
    InventorySkusDataSet skusDataset = skuCollection.DataSet;
    int count = skusDataset.InventorySkus.Count;
    // Iterate through the dataset.
    for (int skusIndex = 0; skusIndex < count; skusIndex++)
    {
        string productId = skusDataset.InventorySkus[skusIndex].ProductId;
        string catalogName = skusDataset.InventorySkus[skusIndex].ProductCatalogName;
        decimal quantity = skusDataset.InventorySkus[skusIndex].OnHandQuantity;
    }
}

The InventorySkusDataSetSchema Class

The InventorySkusDataSetSchema class provides constants for all the built-in columns in the dataset and defines all the associated methods. The following table contains the associated methods for this class.

Method

Description

IsReadOnlyColumn

Returns true if the columnName in the dataset cannot be updated, or false if the columnName in the dataset can be updated.

IsBuiltInColumn

Returns true if the columnName is a built-in column in the dataset, or false if the columnName is a user-defined property.

See Also

Other Resources

Typed Datasets in the Inventory System

Typed Datasets in the Catalog System