ICategory::SetCategoryProperties
Use this method to set values for the properties of this category.
Definition
HRESULT ICategory::SetCategoryProperties(_Recordset*pRSCategory,VARIANTfForceUpdate);
Parameters
pRSCategory
[in] A reference to a Recordset object that contains the properties for this category.
fForceUpdate
[in, optional] A VARIANT that causes a forced update of the category 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_CATEGORY_CHANGED | 0x88980028 | The properties of this category have changed since they were last read. This error is returned only if the fForceUpdate parameter is set to False. |
E_CAT_CATEGORY_DOESNT_EXIST | 0x8898001C | This category has been removed from the catalog. |
E_CAT_INVALIDVALUE_FOR_PROPERTY | 0x88980038 | This error is returned if:
|
E_CAT_NULL_PRICE_NOT_ALLOWED | 0x8898003F | The OriginalPrice field in the pRSCategory recordset was blank or NULL. This field is required if the category is used as a pricing category. |
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 SetCategoryProperties method to modify the properties of a category. The pRSCategory parameter specifies a Recordset object that describes the new property values for this category. Use the Recordset object returned by the GetCategoryProperties method so that its timestamp can be compared for error checking.
If the fForceUpdate parameter is set to False, and the property values in the*****pRSCategory* parameter have changed, the method will fail.
This method will not update the built in fields in the catalog. If this category is being used as a pricing category, then this method will update the price of all the products using this category as the pricing category
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.