Share via


Category3.SetRelatedProducts Method (PIA)

Use this method to update product relationships.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
Imports ADODB26Lib     ' for _Recordset
…
Sub SetRelatedProducts(pRSRelatedProducts As Recordset)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;

using ADODB26Lib; //For _Recordset

…
public void SetRelatedProducts(_Recordset*pRSRelatedProducts);

Parameters

[Visual Basic .NET]

  • pRSRelatedProducts
    A Recordset object that contains the related products.

[C#]

  • pRSRelatedProducts
    A _Recordset object that contains the related products.

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_INVALID_OPERATION_FOR_ROOT_CATEGORY

[C#] 0x889800F8

[Visual Basic .NET] &H889800F8

This API cannot be called for a root category.
E_POINTER

[C#] 0x80004003

[Visual Basic .NET] &H80004003

Invalid pointer.
E_CAT_PRODUCT_DOESNT_EXIST

[C#] 0x8898001E

[Visual Basic .NET] &H8898001E

The product you specified doesn't exist.
E_CAT_DEFN_NO_RELATIONSHIP_EXISTS

[C#] 0x88980045

[Visual Basic .NET] &H88980045

The relationship that you specified either does not exist or is a inherited relationship (and therefore cannot be edited).
E_CAT_VC_ERROR_IN_PROPAGATING_BC_CHANGES

[C#] 0x88980101

[Visual Basic .NET] &H88980101

There was an error in propagating the base catalog changes to the dependent virtual catalogs.

Remarks

The recordset used for the pRSRelatedProducts parameter should be obtained from the get_RelatedProducts method.

Only the RelationshipDescription field should be updated. Other changes should be made by using the RemoveRelationshipToProduct and AddRelationshipToProduct methods.

You can update multiple records in the same call to this method.

When calling this method on an inherited category in a virtual catalog, the method will have no effect if the relationship is inherited from a base catalog. If the relationship was added in the virtual catalog, changes will be updated. Inherited hierarchy and relationship links cannot be removed or changed in inherited categories. To modify inherited relationships, use a Category object obtained from the base Catalog object.

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

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

Category Class

Copyright © 2005 Microsoft Corporation.
All rights reserved.