Share via


ICatalogManager::DeleteDefinition

Ee799809.c++_off(en-US,CS.10).gifEe799809.vb_on(en-US,CS.10).gif

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

Definition

HRESULT ICatalogManager::DeleteDefinition(BSTRstrDefinitionName,VARIANT_BOOLfForceDelete);

Parameters

strDefinitionName

[in] A BSTR that contains the name of the definition to be deleted.

fForceDelete

[in, optional, defaultvalue (0)] A VARIANT_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 only be deleted if it is not currently being used in a catalog.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT 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 0x8898000B The definition you specified did not exist.
E_CAT_DEFINITION_USED_IN_CATALOG 0x8898000C 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, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

See Also

CatalogManager Object

ICatalogManager::CreateCategoryDefinition

ICatalogManager::CreateProductDefinition


All rights reserved.