Jaa


How to Create an Inventory Catalog

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

This topic describes how to create an inventory catalog. An inventory catalog contains products and product variants from your product catalogs. When a product catalog is contained in an inventory catalog, it is said to be mapped to the inventory catalog. An inventory catalog can contain products from multiple product catalogs, but a product catalog can be mapped to only one inventory catalog.

If a virtual catalog does not contain inventory information, the system will get the information in the following manner:

  • If a virtual catalog is not explicitly mapped to an inventory catalog, the inventory catalog that is mapped to the corresponding base catalog will be used.

  • If virtual catalog A contains virtual catalog B, and A is not mapped to an inventory catalog, the inventory catalog that is mapped to virtual catalog B will be used. If virtual catalog B is also not mapped, the inventory catalog that is mapped to the corresponding base catalog will be used.

To create an inventory catalog

  1. Create an inventory catalog by using one of the CreateInventoryCatalog methods of the InventoryContext object.

  2. Map product catalogs to the inventory catalog by using the AddProductCatalog method of the InventoryCatalog object.

  3. Save the inventory catalog.

Example

This example creates an inventory catalog named "SummerClothing". The parameter for this method is an InventoryContext object. The example maps the product catalog "AdventureWorksSummerCatalog" to the inventory catalog.

public static void CreateInventoryCatalog(InventoryContext inventoryContext)
{
    // Create an inventory catalog named "SummerClothing".
    InventoryCatalog inventoryCatalog = inventoryContext.CreateInventoryCatalog("SummerClothing", "Inventory catalog of summer clothing");

    // Add a product catalog - the summer catalog from Adventure Works.
    inventoryCatalog.AddProductCatalog("AdventureWorksSummerCatalog");
    inventoryCatalog.Save();
}

See Also

Other Resources

What Are the Inventory Concepts?

How to Create an InventoryContext Object

How to Create a SKU