שתף באמצעות


RemoveVariant Method

Removes the variant represented by the variantId from the ProductFamily.

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

Syntax

'Declaration
Public Sub RemoveVariant ( _
    variantId As String _
)
'Usage
Dim instance As ProductFamily
Dim variantId As String

instance.RemoveVariant(variantId)
public void RemoveVariant(
    string variantId
)
public:
void RemoveVariant(
    String^ variantId
)
public function RemoveVariant(
    variantId : String
)

Parameters

  • variantId
    Type: System..::.String
    The unique identifier for the variant to remove. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).

Exceptions

Exception Condition
ValidationException

The variantId is invalid.

EntityDoesNotExistException

The variantId does not exist.

Remarks

This method removes a variant from the product family.

The variantId should:

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

  • Not exceed 256 characters.

  • Exist in the catalog.

You should call the Save method to save the changes to the catalog system. The new variant will inherit the values for the normal properties in the definition from the product definition. When the variant is deleted, the variantId is stored in the catalog system to support exporting deleted catalog items. You should call the PurgeDeletedItems method to physically remove this information from the catalog system.

Permissions

See Also

Reference

ProductFamily Class

ProductFamily Members

Microsoft.CommerceServer.Catalog Namespace