CatalogManager.DeleteDefinition

Ee799807.c++_on(en-US,CS.10).gifEe799807.vb_off(en-US,CS.10).gif

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

Definition

Sub DeleteDefinition(strDefinitionName As String,Optional fForceDelete As Boolean)

Parameters

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 only be deleted if it is not currently being used in a catalog. The default value is False.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_CAT_DEFINITION_DOESNT_EXIST &H8898000B The definition you specified did not exist.
E_CAT_DEFINITION_USED_IN_CATALOG &H8898000C This error is only returned when the fForceDelete parameter was set to False and the definition was already used in a catalog.

Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

Remarks

Use a value of True for the fForceDelete parameter with caution, as 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.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

myCatalogManager.DeleteDefinition "T-Shirts", FALSE 

See Also

CatalogManager Object

CatalogManager.CreateCategoryDefinition

CatalogManager.CreateProductDefinition


All rights reserved.