CatalogManager3.AddDefinitionVariantProperty Method (PIA)
Use this method to add a variant property to a definition. This method is similar to the AddDefinitionProperty method. The properties added with this method will only be used by product variants.
Definition
[Visual Basic .NET]
Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub AddDefinitionVariantProperty(strDefinitionName As String,
strPropertyName As String)
[C#]
using Microsoft.CommerceServer.Interop.Catalog;
…
public void AddDefinitionVariantProperty(stringstrDefinitionName,
stringstrPropertyName);
Parameters
[Visual Basic .NET]
- strDefinitionName
A String that contains the name of the definition to which the specified variant property will be added. - strPropertyName
A String that contains the name of the property to be added to the specified definition.
[C#]
- strDefinitionName
A string that contains the name of the definition to which the specified variant property will be added. - strPropertyName
A string that contains the name of the property to be added to the specified definition.
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.
Name | Value | Description |
---|---|---|
E_CAT_CATMGR_NOT_INITIALIZED | [C#] 0x889800B [Visual Basic .NET] &H8898005 |
The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method. |
E_CAT_INVALID_DEFINITION_LENGTH | [C#] 0x889800E [Visual Basic .NET] &H889800A |
The definition name that you specified is invalid. Definition names should be between 1 and 128 characters in length. |
E_CAT_INVALID_PROPERTY_NAME | [C#] 0x889800A [Visual Basic .NET] &H8898002 |
The property name you specified is invalid. Property names cannot be blank and cannot exceed 100 characters. Property names cannot begin with a digit and cannot contain one of the following five reserved characters .,"[] |
E_CAT_DEFINITION_DOESNT_EXIST | [C#] 0x8898000 [Visual Basic .NET] &H889800B |
The definition you specified does not exist. |
E_CAT_PROP_DOESNT_EXIST | [C#] 0x8898000 [Visual Basic .NET] &H8898005 |
The property name you specified does not exist. |
E_CAT_PROP_IN_DEFINITION | [C#] 0x8898000 [Visual Basic .NET] &H889800D |
The property you specified is already part of that definition. |
E_CAT_ERROR_VARIANT_PROP | [C#] 0x889800A [Visual Basic .NET] &H8898003 |
A variant property cannot be added to a category definition. |
Remarks
This method adds a variant property to a definition. Any product variants created from the definition will also have the property. A property can be added to a definition only once. A property cannot be used in a product definition as both a property and a variant property.
[Visual Basic .NET]
Example
myCatalogManager.AddDefinitionVariantProperty("T-Shirts", "Size")
Requirements
Namespace: Microsoft.CommerceServer.Interop.Catalog
Platforms: Windows 2000, Windows Server 2003
Assembly: cataloglib (in cataloglib.dll)
See Also
CatalogManager3.AddDefinitionProperty
CatalogManager3.RemoveDefinitionProperty
Copyright © 2005 Microsoft Corporation.
All rights reserved.