Product.SetProductProperties

Ee823317.c++_on(en-US,CS.10).gifEe823317.vb_off(en-US,CS.10).gif

Use this method to set the properties for this product.

Definition

Sub SetProductProperties(pRSProduct As Recordset,Optional fForceUpdate As Variant)

Parameters

pRSProduct

A Recordset object that contains the new product properties. This should be an updated recordset returned by the GetProductProperties method.

fForceUpdate

A Variant that determines whether to force an update of the product 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_INVALID_LISTPRICE &H8898003C The value specified for the list price was invalid.
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_PRODUCT_DOESNT_EXIST &H8898001E The specified product ID did not exist.

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 SetProductProperties method to modify the properties of a product. The pRSProduct parameter specifies a Recordset object that describes the new property values for this product. This method will not update the fields derived from the catalog such as ProductId and VariantID. If this method is called for a product family it will update the properties for all variants that belong to the Product family.

Use the Recordset object returned by the GetProductProperties property so that the timestamps can be compared to the records updated by this method for error detection.

If the fForceUpdate parameter is set to False, and the property values for this product have been changed since the pRSProduct record set was read, the method will fail.

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

Example

'This example changes the list price for a product
set rsProductProps = myProduct.GetProductProperties
rsProductProps.fields("cy_list_price").value = CCur(1.398)
myProduct.SetProductProperties rsProductProps, TRUE

See Also

Product Object

Product.GetProductProperties


All rights reserved.