IProduct::get_PricingCategory, put_PricingCategory
The PricingCategory property is a read/write String that contains the name of the pricing category for this product.
Definition
Get method:
HRESULT IProduct::get_PricingCategory(BSTR*PricingCategory);SET
Put method:
HRESULT IProduct::put_PricingCategory(BSTRPricingCategory);
Parameters
PricingCategory
[in] When using the put method, a BSTR that contains the pricing category.
[out, retval] When using the get method, a pointer to a BSTR used to return the pricing category.
Return Values
These methods return an HRESULT indicating whether they completed successfully. See the Error Values section for more details.
Error Values
These methods return 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_DOESNT_EXIST | 0x8898001C | The specified category did not exist. |
E_CAT_PRICING_CAT_PRICELESS | 0x8898002F | The specified category did not have a list price.
Categories that do not have a list price cannot be used as a pricing category. |
E_CAT_PRODUCT_DOESNT_EXIST | 0x8898001E | This product has been deleted. |
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
The PricingCategory parameter contains valid data only if the property was accessed successfully.
Using a category as a Pricing category allows you to set the prices of multiple products by making a single change, rather than having to change the price for each product. Setting the Pricing category for a product family will also set the Pricing category for all the variants of the product family.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.