IProductCatalog::DeleteCategory

Ee785004.c++_off(en-US,CS.10).gifEe785004.vb_on(en-US,CS.10).gif

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

Definition

HRESULT IProductCatalog::DeleteCategory(BSTRstrCategoryName);

Parameters

strCategoryName

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

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 error that this method can return.

Constant Value Description
E_CAT_CATEGORY_DOESNT_EXIST 0x8898001C The specified category did not exist.

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

Any products or categories that existed in the deleted category, but not in another category, will be orphaned. Categories will become root categories and products will become root products. For example: CategoryA and CategoryB are child categories of CategoryX. CategoryA is also a child of CategoryY. When CategoryX is deleted, CategoryB will become a root category, but CategoryA will not.

If this category has been specified as a Pricing category for a custom catalog, it will be removed as the Pricing category. All the products using this category as a Pricing category will revert to their original price and the category will be removed as the Pricing category

See Also

ProductCatalog Object

IProductCatalog::get_RootCategories

IProductCatalog::CreateCategory

IProductCatalog::GetCategory


All rights reserved.