Share via


RemoveChildCategory Method

Removes the category as a child of the current category.

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

Syntax

'Declaration
Public Sub RemoveChildCategory ( _
    categoryName As String _
)
'Usage
Dim instance As StaticCategory
Dim categoryName As String

instance.RemoveChildCategory(categoryName)
public void RemoveChildCategory(
    string categoryName
)
public:
void RemoveChildCategory(
    String^ categoryName
)
public function RemoveChildCategory(
    categoryName : String
)

Parameters

Exceptions

Exception Condition
ArgumentNullException

The categoryName is nullNothingnullptra null reference (Nothing in Visual Basic).

ValidationException

The category is a root category.

EntityDoesNotExistException

The categoryName does not exist in the category.

Remarks

This method removes the categoryName from the current category. The categoryName should:

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

  • Not exceed 215 characters.

  • Exist in the catalog.

  • Already exist as a child category for this category.

If this category is in a virtual catalog and you want to remove a categoryName from one of the included base catalogs you should pass the categoryName in the format categoryName(BaseCatalogName) For example if you include a category "Autobiographies" from a "Books" catalog in a virtual catalog named AllBooks then to remove the category you should use string categoryName = @"Autobiographies(Books)"; category.RemoveChildCategory(categoryName); You should call the Save method to save the changes to the catalog system.

Permissions

See Also

Reference

StaticCategory Class

StaticCategory Members

Microsoft.CommerceServer.Catalog Namespace