Product.SetVariantProperties

Ee823404.c++_on(en-US,CS.10).gifEe823404.vb_off(en-US,CS.10).gif

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

Definition

Sub SetVariantProperties(pRSNewState As _Recordset,Optional fForceUpdate As Variant)

Parameters

pRSNewState

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

A Variant that determines whether to force an update of the product variant properties.

Return Values

None.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS &H88980032 Catalog does not support variants.
E_CAT_INVALIDVALUE_FOR_PROPERTY &H88980038 An invalid value was specified for one of the product properties. This error was returned if:
  • One of the properties did not satisfy the Min/Max condition.

  • The properties of string or enumeration data type exceeded the maximum length.

  • The value of the enumeration property was not one of the legal values defined.
E_CAT_PRODUCT_CHANGED &H88980027 This product's properties were changed since they were last read. This error is returned only if the fForceUpdate parameter is set to False.
E_CAT_VARIANT_DOESNT_EXIST &H8898001F This product variant has been removed from the catalog.

Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

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.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Example

myProduct.SetVariantProperties pRSNewState, fForceUpdate

See Also

Product Object

Product.GetVariantProperties


All rights reserved.