DeleteInventoryCatalog Method

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

This method deletes an InventoryCatalog from the inventory system.

Namespace:  Microsoft.CommerceServer.Inventory
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Sub DeleteInventoryCatalog ( _
    catalogName As String _
)
'Usage
Dim instance As InventoryContext
Dim catalogName As String

instance.DeleteInventoryCatalog(catalogName)
public void DeleteInventoryCatalog(
    string catalogName
)
public:
void DeleteInventoryCatalog(
    String^ catalogName
)
public function DeleteInventoryCatalog(
    catalogName : String
)

Parameters

  • catalogName
    Type: System..::.String
    The name of the inventory catalog. May not be nullNothingnullptra null reference (Nothing in Visual Basic).

Remarks

Deleting an inventory catalog will physically delete the inventory catalog and the inventory information associated with the products from the inventory system. Once deleted there is no way to retrieve the deleted inventory catalog. After an inventory catalog is deleted all the product catalogs associated with the inventory catalog will become unassociated and can be associated with other inventory catalogs. Note that the Default inventory catalog cannot be deleted.

The catalogName should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 85 characters.

  • Not contain the .,"[]'()# characters.

Examples

This example demonstrates how to delete an inventory catalog.

public void DeleteInventoryCatalog()
{
  try
  {
    inventoryContext.DeleteInventoryCatalog("name of the inventory catalog");
  }
  catch (ValidationException ex)
  {
    Console.WriteLine(ex.Message);
  }
  catch (CatalogDatabaseException ex)
  {
    Console.WriteLine(ex.Message);
  }
  catch (EntityDoesNotExistException ex)
  {
    // ex.EntityId will contain the name of the inventory catalog
    Console.WriteLine(ex.Message);
  }
} 

Permissions

See Also

Reference

InventoryContext Class

InventoryContext Members

Microsoft.CommerceServer.Inventory Namespace