Share via


Product3.SetVariantProperties Method (PIA)

Use this method to set the properties for a variant of this product.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
Imports ADODB26Lib     ' for _Recordset
…
Public Sub SetVariantProperties(pRSNewState As _Recordset,
  Optional fForceUpdate As Object)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;

using ADODB26Lib; //For _Recordset

…
public void SetVariantProperties(_RecordsetpRSNewState,
  objectfForceUpdate);

Parameters

[Visual Basic .NET]

  • pRSNewState
    The _Recordset interface to a Recordset object that contains the new product variant properties. This should be a recordset returned by the GetVariantProperties property or by the CreateVariant method.
  • fForceUpdate
    An Object that determines whether to force an update of the product variant properties.

[C#]

  • pRSNewState
    A**_Recordset** interface to a Recordset object that contains the new product variant properties. This should be a Recordset returned by the GetVariantProperties property or by the CreateVariant method.

    fForceUpdate

    An object that determines whether to force an update of the product variant properties. Set to Type.Missing for default behavior.

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_INVALID_PARAMETER

[C#] 0x889800B6

[Visual Basic .NET] &H889800B6

The input parameter <parameter number> is invalid.
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_VARIANT_DOESNT_EXIST

[C#] 0x8898001F

[Visual Basic .NET] &H8898001F

The product variant you specified does not exist.
E_CAT_PRODUCT_CHANGED

[C#] 0x88980027

[Visual Basic .NET] &H88980027

The product variant has been changed since it was last read.
E_CAT_INVALID_PROPERTY_VALUE

[C#] 0x889800B4

[Visual Basic .NET] &H889800B4

The value <value> specified for the property <property name>does not satisfy the Minimum or Maximum constraints defined for the property. For string properties, the specified value should lie between the minimum and maximum lengths defined for the property. For numeric properties, the specified value should lie between a minimum and maximum value. For enumeration properties, the specified value should be one of the valid values defined for the property.
E_CAT_INVALID_LISTPRICE

[C#] 0x8898003C

[Visual Basic .NET] &H8898003C

An invalid list price is specified for this product or variant. The list price cannot be empty for the products and variants.

Remarks

Use the SetVariantProperties method to modify the properties of a product variant. The pRSNewState parameter specifies a Recordset object that describes the new property values for this product variant. Use the Recordset returned by the GetVariantProperties property or by the CreateVariant method, so that timestamps can be compared for error detection.

If the fForceUpdate parameter is set to false, and the property values in the*****pRSNewState* parameter have changed, the method will fail.

[Visual Basic .NET]

Example

myProduct.SetVariantProperties(pRSNewState, fForceUpdate)

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: Cataloglib (in Cataloglib.dll)

See Also

Product3 Class

Product3.GetVariantProperties

Copyright © 2005 Microsoft Corporation.
All rights reserved.