Partager via


What Are the Import Options for Inventory Catalogs?

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

To import an inventory catalog, use one of the ImportXml methods of the InventoryContext object. This method lets you specify whether to import the catalog from an XML file or as a data stream.

Use the properties of the InventoryImportOptions parameter to specify the options that control the import operation. These options are identical to the import options used to import a product catalog, but they contain an additional property. For information about these import options, see What Are the Import Options?

The options to import an inventory catalog include the ProductCatalogsToReplace property. This property affects how the Mode property behaves.

The Mode property provides two modes for importing inventory data. The Full mode erases all data in the Inventory System for the specified catalogs and replaces it with the contents of the XML file. You specify which catalogs to replace by using the ProductCatalogsToReplace property. If you do not specify this property, this mode deletes all inventory information associated with the inventory catalog. That is, it deletes all mappings in all product catalogs and all SKUs. It replaces the deleted information with the data from the XML file. This property is used to replace only specific product catalogs mapped to one inventory catalog instead of replacing all the product catalogs mapped to the inventory catalog. If the inventory catalog in the XML file does not exist in the Inventory System, this mode creates a new catalog.

You can selectively replace data in the inventory catalog by using the Incremental mode. If an inventory catalog exists in the XML file and in the Inventory System, this mode updates the inventory catalog with the data in the XML file. If a SKU exists in both the XML file and the inventory catalog, this mode updates the SKU in the catalog. If the SKU does not exist in the catalog, this mode creates a new SKU. If the catalog does not exist in the Inventory System, this mode creates the catalog.

You use the PropertiesToImport property to specify the properties to import. Only the properties specified and the required properties are imported. However, in the Incremental mode, if the SKU already exists, and if the required property OnHandQuantity is not one of the properties to import, then that property is not imported.

If the SKU does not exist in the inventory catalog and if the required property OnHandQuantity is not one of the properties to import, then an exception is thrown because these are required fields and they do not have default values.

See Also

Other Resources

What Are the Export Options for Inventory Catalogs?