IProduct::GetVariantProperties
Use this method to retrieve the properties for a specified product variant.
Definition
HRESULT IProduct::GetVariantProperties(VARIANTvarProductVariantID,_Recordset**ppRSProductVariant);
Parameters
varProductVariantID
[in] A VARIANT that contains the unique ID of the product variant.
ppRSProductVariant
[out, retval] A pointer to a Recordset object used to return the product variant 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_CATALOG_DOESNT_SUPPORT_VARIANTS | 0x88980032 | This catalog does not support product variants. |
E_CAT_VARIANT_DOESNT_EXIST | 0x8898001F | This product variant has been removed from the catalog. |
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 ppRSProductVariant parameter contains valid data only if the property was accessed successfully.
This method returns the properties of the specified product variant. If the product variant specified in the varProductVariantID parameter does not exist in the product, the method will fail.
The single-row recordset returned contains fields for all of the properties defined for variants of this product followed by the following fields:
Field | Type | Description |
TimeStamp | Timestamp | None |
cy_list_price | Currency | List price |
oid | Integer | None |
The oid field is for internal use only and should not be updated.
The recordset returned is updateable, but disconnected. To modify the product properties, pass this recordset to the SetVariantProperties method.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.