Share via


IProductCatalog3::GetPriceRules Method [C++]

Use this method to return a recordset containing the specified price rules. This method cannot be used with a base catalog.

Definition

[C++]

HRESULT IProductCatalog3::GetPriceRules(VARIANTlStartingRecord,
  VARIANTlRecordsToRetrieve,
  VARIANTstrPropertyToSortOn,
  VARIANT_BOOLfSortAscending,
  VARIANT*plTotalRecordsInQuery,
  _Recordset**ppRSProductPricingRules);

[Visual Basic]

Function GetPriceRules(Optional lStartingRecord As Variant,
  Optional lRecordsToRetrieve As Variant,
  Optional strPropertyToSortOn As Variant,
  Optional fSortAscending As Boolean,
  Optional plTotalRecordsInQuery As Variant) As _Recordset

Parameters

  • lStartingRecord[C++]
    [in, optional] A VARIANT that contains the starting record number. A value of one (1) indicates the first record. If the starting record number is not specified, then this method starts with record one (1).
  • lStartingRecord[Visual Basic]
    A Variant that contains the starting record number. A value of one (1) indicates the first record. If the starting record number is not specified, then this method starts with record one (1).
  • lRecordsToRetrieve[C++]
    [in, optional] A VARIANT that contains the number of records to retrieve.
  • lRecordsToRetrieve[Visual Basic]
    A Variant that contains the number of records to retrieve.
  • strPropertyToSortOn[C++]
    [in, optional] A VARIANT that contains the property on which to sort. This must be a property in the returned recordset. If not included, the returned recordset will be unsorted.
  • strPropertyToSortOn[Visual Basic]
    A Variant that contains the property on which to sort. This must be a property in the returned recordset. If not included, the returned recordset will be unsorted.
  • fSortAscending[C++]
    [in, optional, defaultvalue (-1)] A VARIANT_BOOL that specifies whether to sort in ascending or descending order. A value of True (-1) indicates to sort in ascending order. A value of False (0) indicates to sort in descending order.
  • fSortAscending[Visual Basic]
    A Boolean that specifies whether to sort in ascending or descending order. A value of True (-1) indicates to sort in ascending order. A value of False (0) indicates to sort in descending order. The default value is True.
  • plTotalRecordsInQuery[C++]
    [in, out, optional] A pointer to a VARIANT that, if supplied, contains on output the total number of records.
  • plTotalRecordsInQuery[Visual Basic]
    A Variant that, if supplied, contains on output the total number of records.
  • ppRSProductPricingRules[C++]
    [out, retval] A pointer to hold the reference to the returned Recordset object, which will contain the product pricing rules.

Return Values

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

[Visual Basic] If this method completes successfully, it returns a Recordset object that contains the pricing rules.

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 error 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_INVALID_RS_POINTER

[C++] 0x889800B7

[Visual Basic] &H889800B7

The recordset pointer that you specified is invalid
E_CAT_INVALID_SORT_PROPS

[C++] 0x8898011E

[Visual Basic] &H8898011E

The properties to sort that you specified are invalid. Properties that contain a space should be enclosed in square brackets. Properties should not contain [ or ] and /* or -- in property names.

[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

[C++] The ppRSProductPricingRules parameter contains valid data only if the method was accessed successfully.

The returned recordset is disconnected and updateable. The following table shows the fields that the returned recordset contains.

Field Data Type Description
AdjustmentType CatalogCustomPriceEnum enumeration The type of the pricing rule.
Amount Integer None
CategoryName String
85 characters
None
ProductID String
256 characters
The field name that uniquely identifies products.
VariantID String
256 characters
The field name that uniquely identifies variants.

The following table shows the values of the CatalogCustomPriceEnum enumeration, their associated names, and describes their use.

Name Value Description
cscNoCustomPrice 0 The custom price is the same as the base price.
cscPercentageMultiplier 1 The custom price = basePrice + (basePrice * pfpCustomPriceAmount /100).
cscAddFixedAmount 2 The custom price is the value in the parameter pfpCustomPriceAmount added to the base price.
cscReplacePrice 3 The custom price is the value in the parameter pfpCustomPriceAmount.
cscInvalidCustomPrice -1 Reserved for future use.

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

[Visual Basic]

Example

'plTotalRecordsInQuery is a LONG. 
'Examine it after the method returns to see if 
'there are more records to get.
Set rsPriceRules = myProductCatalog.GetPriceRules(1, 25, strPropertyToSortOn, True, plTotalRecordsInQuery)

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.