CatalogManager3.CreateProductDefinition Method (PIA)

Use this method to create a new product definition.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub CreateProductDefinition(strDefinitionName As String)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public void CreateProductDefinition(stringstrDefinitionName);

Parameters

[Visual Basic .NET]

  • strDefinitionName
    A String that contains the name of the new product definition.

[C#]

  • strDefinitionName
    A string that contains the name of the new product 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_DEFINITION_EXISTS

[C#] 0x8898000

[Visual Basic .NET] &H889800A

The definition you specified already exists.
E_CAT_DEFN_NAME_EXISTS_AS_CATEGORY

[C#] 0x8898004

[Visual Basic .NET] &H8898003

A category definition with the name you specified already exists. Definition names should be unique across Category and Product definitions.

Remarks

Category and product definition names must be globally unique across the entire Product Catalog System. It is not possible to have a category definition and a product definition with the same name.

The initial definition is empty when it is created. To add individual properties to the definition, use the AddDefinitionProperty or AddDefinitionVariantProperty method.

[Visual Basic .NET]

Example

myCatalogManager.CreateProductDefinition("Microwave")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.AddDefinitionProperty

CatalogManager3.AddDefinitionVariantProperty

CatalogManager3.CreateCategoryDefinition

CatalogManager3.DeleteDefinition

Copyright © 2005 Microsoft Corporation.
All rights reserved.