Share via


IProductCatalog3::RemovePriceRule Method [C++]

Use this method to remove a specified price rule.

Definition

[C++]

HRESULT IProductCatalog3::RemovePriceRule(VARIANTvrProductIDOrCategoryName,
  VARIANTvrVariantID,
  VARIANT_BOOLfCategory);

[Visual Basic]

Sub RemovePriceRule(vrProductIDOrCategoryName As Variant,
  Optional vrVariantID As Variant,
  Optional fCategory As Boolean)

Parameters

  • vrProductIDOrCategoryName[C++]
    [in] A VARIANT that contains the product ID or category name to which the rule applies.
  • vrProductIDOrCategoryName[Visual Basic]
    A Variant that contains the product ID or category name to which the rule applies.
  • vrVariantID[C++]
    [in, optional] A VARIANT that contains the variant ID, if the rule is specific to a variant.
  • vrVariantID[Visual Basic]
    A Variant that contains the variant ID, if the rule is specific to a variant.
  • fCategory[C++]
    [in, optional, defaultvalue (0)] A VARIANT_BOOL that specifies whether the parameter vrProductIDOrCategoryName is a product or a category. A value of True (-1) indicates a category. A value of False (0) indicates a product.
  • fCategory[Visual Basic]
    A Boolean that specifies whether vrProductIDOrCategoryName is a product or a category. A value of True (-1) indicates a category. A value of False (0) indicates a product. The default value is False (0).

Return Values

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

[Visual Basic] None.

Error Values

[C++] 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.

[Visual Basic] 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_VC_NOT_A_VIRTUAL_CATALOG

[C++] 0x889800FA

[Visual Basic] &H889800FA

Invalid catalog type. This API can only be called on a virtual catalog.
E_CAT_VC_INVALID_PROD_ID_OR_CATEGORY_NAME

[C++] 0x889800FB

[Visual Basic] &H889800FB

The value you specified for the ProductID or CategoryName exceeds the maximum allowed length of 348 characters.
E_CAT_VC_INVALID_VARIANT_ID

[C++] 0x889800FC

[Visual Basic] &H889800FC

The value you specified for the VariantID exceeds the maximum allowed length of 348 characters.
E_CAT_VC_INVALID_ITEM

[C++] 0x889800FD

[Visual Basic] &H889800FD

The specified product/category/variant could not be found in the base catalog.
E_CAT_VC_DELETION_PRICE_RULE_NOT_FOUND

[C++] 0x88980100

[Visual Basic] &H88980100

The pricing rule could not be deleted because it doesn't exist.

[C++] 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.

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

Remarks

Set the fCategory parameter to True and the vrProductIDOrCategoryName parameter to an empty string to remove the price rule for the entire catalog.

The vrVariantID parameter is only valid for products. If it is supplied, it indicates that the rule should be removed for that variant only.

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

[Visual Basic]

Example

myProductCatalog.RemovePriceRule("shoes", , True)

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.