IProduct::SetProductProperties

Ee798736.c++_off(en-US,CS.10).gifEe798736.vb_on(en-US,CS.10).gif

Use this method to set the properties for this product.

Definition

HRESULT IProduct::SetProductProperties(_Recordset*pRSProduct,VARIANTfForceUpdate);

Parameters

pRSProduct

[in] A pointer to a Recordset object that contains the new product properties. This should be an updated recordset returned by the GetProductProperties method.

fForceUpdate

[in, optional] A VARIANT that determines whether to force an update of the product properties.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and either standard or custom COM HRESULT 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 0x8898003C The value specified for the list price was invalid.
E_CAT_INVALIDVALUE_FOR_PROPERTY 0x88980038 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 0x88980027 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 0x8898001E The specified product ID did not exist.

Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

See Also

Product Object

IProduct::GetProductProperties


All rights reserved.