RemoveParentCategory Method

Removes the category as a parent of the current category.

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

Syntax

'Declaration
Public Sub RemoveParentCategory ( _
    categoryName As String _
)
'Usage
Dim instance As CatalogItem
Dim categoryName As String

instance.RemoveParentCategory(categoryName)
public void RemoveParentCategory(
    string categoryName
)
public:
void RemoveParentCategory(
    String^ categoryName
)
public function RemoveParentCategory(
    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 parent 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.RemoveParentCategory(categoryName); You should call the Save method to save the changes to the catalog system.

Permissions

See Also

Reference

CatalogItem Class

CatalogItem Members

Microsoft.CommerceServer.Catalog Namespace