Product3.SetProductProperties Method (PIA)
Use this method to set the properties for this product.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop.Catalog
Imports ADODB26Lib ' for _Recordset
…
Public Sub SetProductProperties(pRSProduct As _Recordset,
Optional fForceUpdate As Object)
[C#]
using Microsoft.CommerceServer.Interop.Catalog;
using ADODB26Lib; //For _Recordset
…
public void SetProductProperties(_RecordsetpRSProduct,
objectfForceUpdate);
Parameters
[Visual Basic .NET]
- pRSProduct
A _Recordset interface to a Recordset object that contains the new product properties. This should be an updated recordset returned by the GetProductProperties method. - fForceUpdate
An Object that determines whether to force an update of the product properties.
[C#]
- pRSProduct
A**_Recordset** interface to a Recordset object that contains the new product properties. This should be an updated Recordset returned by the GetProductProperties method. - fForceUpdate
An object that determines whether to force an update of the product properties. Set to Type.Missing for default behavior.
Exceptions
This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.
The following table shows the custom COM errors that a COMException can wrap.
Constant | Value | Description |
---|---|---|
E_CAT_VC_NOT_A_SUPPLIER_CATALOG | [C#] 0x889800F9 [Visual Basic .NET] &H889800F9 |
Invalid catalog type. This API can only be called on a base catalog. |
E_CAT_INVALID_PARAMETER | [C#] 0x889800B6 [Visual Basic .NET] &H889800B6 |
The input parameter <parameter number> is invalid. |
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS | [C#] 0x88980032 [Visual Basic .NET] &H88980032 |
This catalog does not support variants. To support variants, the catalog must be created with a variant identifier. |
E_CAT_PRODUCT_DOESNT_EXIST | [C#] 0x8898001E [Visual Basic .NET] &H8898001E |
The product you specified does not exist. |
E_CAT_PRODUCT_CHANGED | [C#] 0x88980027 [Visual Basic .NET] &H88980027 |
The product variant has been changed since it was last read. |
E_CAT_INVALID_PROPERTY_VALUE | [C#] 0x889800B4 [Visual Basic .NET] &H889800B4 |
The value <value> specified for the property <property name>does not satisfy the Minimum or Maximum constraints defined for the property. For string properties, the specified value should lie between the minimum and maximum lengths defined for the property. For numeric properties, the specified value should lie between the minimum and maximum values. For enumeration properties, the specified value should be one of the valid values defined for the property. |
E_CAT_INVALID_LISTPRICE | [C#] 0x8898003C [Visual Basic .NET] &H8898003C |
An invalid list price is specified for this product or variant. The list price cannot be empty for the products and variants. |
Remarks
Use the SetProductProperties method to modify the properties of a product. The pRSProduct parameter specifies a Recordset object that describes the new property values for this product. This method will not update the fields derived from the catalog such as ProductId and VariantID. If this method is called for a product family it will update the properties for all variants that belong to the product family.
Use the Recordset object returned by the GetProductProperties property so that the timestamps can be compared to the records updated by this method for error detection.
If the fForceUpdate parameter is set to false, and the property values for this product have been changed since the pRSProduct recordset was read, the method will fail.
[Visual Basic .NET]
Example
'This example changes the list price for a product
rsProductProps = myProduct.GetProductProperties()
rsProductProps.fields("cy_list_price").Value() = CCur(1.398)
myProduct.SetProductProperties(rsProductProps, TRUE)
Requirements
Namespace: Microsoft.CommerceServer.Interop.Catalog
Platforms: Windows 2000, Windows Server 2003
Assembly: Cataloglib (in Cataloglib.dll)
See Also
Copyright © 2005 Microsoft Corporation.
All rights reserved.