Share via


Product3.DeleteVariant Method (PIA)

Use this method to delete the specified product variant. This method applies to base catalogs only.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub DeleteVariant(varVariantID As Object)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void DeleteVariant(objectvarVariantID);

Parameters

[Visual Basic .NET]

  • varVariantID
    An Object that contains the unique ID of the variant.

[C#]

  • varVariantID
    An object that contains the unique ID of the variant.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

The following table shows the custom COM errors that a COMException can wrap.

Constant Value Description
E_CAT_VC_NOT_A_SUPPLIER_CATALOG

[C#] 0x889800F9

[Visual Basic .NET] &H889800F9

Invalid catalog type. This API can only be called on a base catalog.
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS

[C#] 0x88980032

[Visual Basic .NET] &H88980032

This catalog does not support variants. To support variants, the catalog must be created with a variant identifier.
E_CAT_INVALID_PARAMETER

[C#] 0x889800B6

[Visual Basic .NET] &H889800B6

The input parameter <parameter number> is invalid.
E_CAT_INVALID_VARIANTID

[C#] 0x8898005C

[Visual Basic .NET] &Hx8898005C

The value you specified for the VariantID exceeds the maximum allowed length of 256 characters.
E_CAT_INVALIDVALUE_FOR_VARIANTID

[C#] 0x8898004D

[Visual Basic .NET] &H8898004D

The value you specified for the VariantID is either out of range or does not satisfy the Min/Max condition.
E_CAT_BLANK_VARIANT

[C#] 0x8898004F

[Visual Basic .NET] &H8898004F

You have specified a blank value for the VariantID. A variant cannot be created with a blank value.
E_CAT_VC_INVALID_VARIANT_ID

[C#] 0x889800FC

[Visual Basic .NET] &H889800FC

The value you specified for the VariantID exceeds the maximum allowed length of 348 characters.
E_CAT_VARIANT_DOESNT_EXIST

[C#] 0x8898001F

[Visual Basic .NET] &H8898001F

The product variant you specified does not exist.

[Visual Basic .NET]

Example

'objID is an Object containing the unique ID 
'for the product variant.
myProduct.DeleteVariant(objID)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: Cataloglib (in Cataloglib.dll)

See Also

Product3 Class

Product3.CreateVariant

Copyright © 2005 Microsoft Corporation.
All rights reserved.