CatalogManager3.DeleteDefinition Method (PIA)

Use this method to delete a definition from the Product Catalog System.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub DeleteDefinition(strDefinitionName As String,
  Optional fForceDelete As Boolean)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void DeleteDefinition(stringstrDefinitionName,
  boolfForceDelete);

Parameters

[Visual Basic .NET]

  • strDefinitionName
    A String that contains the name of the definition to be deleted.
  • fForceDelete
    A Boolean that specifies whether to force a deletion. A value of True indicates that the definition should be deleted even if it is currently being used in a catalog. A value of False indicates that the definition should be deleted only if it is not currently being used in a catalog. The default value is False.

[C#]

  • strDefinitionName
    A string that contains the name of the definition to be deleted.

  • fForceDelete
    A bool that specifies whether to force a deletion. A value of True indicates that the definition should be deleted even if it is currently being used in a catalog. A value of

    False indicates that the definition should be deleted only if it is not currently being used in a catalog.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

The following table shows the custom COM errors that a COMException can wrap.

Name Value Description
E_CAT_CATMGR_NOT_INITIALIZED

[C#] 0x889800B

[Visual Basic .NET] &H8898005

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method.
E_CAT_INVALID_DEFINITION_LENGTH

[C#] 0x889800E

[Visual Basic .NET] &H889800A

The definition name that you specified is invalid. Definition names should be between 1 and 128 characters in length.
E_CAT_DEFINITION_DOESNT_EXIST

[C#] 0x8898000

[Visual Basic .NET] &H889800B

The Definition you specified does not exist.
E_CAT_DEFINITION_USED_IN_CATALOG

[C#] 0x8898000

[Visual Basic .NET] &H889800C

You cannot delete the Definition because it is still being used by one or more Catalogs. To delete the Definition, first remove all products and/or categories based on that Definition from all Catalogs.

Remarks

Use a value of True for the fForceDelete parameter with caution, because the category or product definition, and all categories and products that are based on them in all catalogs will also be deleted. This could result in data loss.

[Visual Basic .NET]

Example

myCatalogManager.DeleteDefinition("T-Shirts", False)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.CreateCategoryDefinition

CatalogManager3.CreateProductDefinition

Copyright © 2005 Microsoft Corporation.
All rights reserved.