CatalogManager3.CreateCatalog Method (PIA)

Use this method to create a new catalog.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Function CreateCatalog(strCatalogName As String,
  OptionalstrProductID As String,
  Optional strProductVariantID As Object,
  Optional lcidLocale As Object,
  Optional strCurrency As Object,
  Optional strWeightMeasure As Object,
  Optional dtStartDate As Object,
  Optional dtEndDate As Object,
  Optional vrDefaultLanguage As Object,  Optional vrReportingLanguage As Object,
  Optional fVirtualCatalog As Boolean) As IProductCatalog

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
…
public  IProductCatalog CreateCatalog(stringstrCatalogName,
  stringstrProductID,
  objectstrProductVariantID,
  objectlcidLocale,
  objectstrCurrency,
  objectstrWeightMeasure,
  objectdtStartDate,
  objectdtEndDate,
  object vrDefaultLanguage,
  object vrReportingLanguage,
  Boolean fVirtualCatalog,
);

Parameters

[Visual Basic .NET]

  • strCatalogName
    A String that contains the name of the catalog to be created. See the Remarks section for a list of restricted characters.
  • strProductID
    A String that contains the product ID property.
  • strProductVariantID
    An Object that contains the product variant ID property.
  • lcidLocale
    An Object that contains the locale ID (LCID) of the catalog to be created.
  • strCurrency
    An Object that contains the currency type of the catalog to be created.
  • strWeightMeasure
    An Object that contains the unit of weight or measure of the catalog to be created.
  • dtStartDate
    An Object of subtype System.DateTime that contains the start date.
  • dtEndDate
    An Object of subtype System.DateTime that contains the end date.
  • vrDefaultLanguage
    An Object that contains the default language identifier. The default value is the system default language.
  • vrReportingLanguage
    An Object that contains the reporting language identifier. The default value is the value of the vrDefaultLanguage parameter, if supplied; otherwise, it is the system default language.
  • fVirtualCatalog
    A Boolean that specifies whether to create a virtual Catalog object. A value of True specifies create a virtual Catalog object. A value of False specifies create a base Catalog object. The default value is False.

[C#]

  • strCatalogName
    A string that contains the name of the catalog to be created. See the Remarks section for a list of restricted characters.
  • strProductID
    A string that contains the product ID property.
  • strProductVariantID
    An object that contains the product variant ID property. Optionally, specify no product variant ID by setting this to Type.Missing.
  • lcidLocale
    An object that contains the locale ID (LCID) of the catalog to be created. Optionally, specify no locale ID by setting this to Type.Missing.
  • strCurrency
    An object that contains the currency type of the catalog to be created. Optionally, specify no currency type by setting this to Type.Missing.
  • strWeightMeasure
    An object that contains the unit of weight or measure of the catalog to be created. Optionally, specify no unit of weight or measure by setting this to Type.Missing.
  • dtStartDate
    An object that contains the start date. Optionally, specify no start date by setting this to Type.Missing.
  • dtEndDate
    An object of subtype DATE that contains the end date. Optionally, specify no end date by setting this to Type.Missing.
  • VrDefaultLanguage
    An object that contains the default language identifier. The default value is the system default language.
  • VrReportingLanguage
    An object that contains the reporting language identifier. The default value is the value of the vrDefaultLanguage parameter, if supplied; otherwise, it is the system default language.
  • fVirtualCatalog
    A Boolean that specifies whether to create a virtual Catalog object. A value of True specifies create a virtual Catalog object. A value of False specifies create a base Catalog object. The default value is False.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns an IProductCatalog interface to the ProductCatalog object that was created.

[C#] This method returns the IProductCatalog interface to the new catalog.

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_CATMGR_NOT_INITIALIZED

[C#] 0x889800B5

[Visual Basic .NET] &H889800B5

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method
E_CAT_INVALID_CATALOGNAME

[C#] 0x88980063

[Visual Basic .NET] &H88980063

The catalog name you specified is invalid. The strCatalogNames parameter cannot be blank.
E_CAT_INVALID_CATALOG_NAME_LENGTH

[C#] 0x88980042

[Visual Basic .NET] &H88980042

The catalog name you specified exceeds the maximum limit of 85 characters.
E_CAT_CHARACTER_NOT_ALLOWED

[C#] 0x8898003D

[Visual Basic .NET] &H8898003D

The catalog name you specified has one of the following nine reserved characters:
" [ ] , ' ( )#.

You should not use these characters.

E_CAT_INVALID_PARAMETER

[C#] 0x889800B6

[Visual Basic .NET] &H889800B6

The input parameter <parameter number> is invalid.
E_CAT_INVALID_LANGUAGE

[C#] 0x8898009E

[Visual Basic .NET] &H8898009E

The value you specified for the Language parameter is either empty or exceeds the maximum length of 10 characters.
E_CAT_INVALID_PROPERTY_NAME

[C#] 0x889800A2

[Visual Basic .NET] &H889800A2

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_PRODID_DOESNT_EXIST

[C#] 0x88980010

[Visual Basic .NET] &H88980010

The ProductID you requested to use for this catalog does not exist in the Product Catalog System. You must first create the Property, after which you may create the Catalog that is based on it.
E_CAT_VARIANTID_DOESNT_EXIST

[C#] 0x88980061

[Visual Basic .NET] &H88980061

The VariantID you requested to use for this catalog does not exist in the Product Catalog System. You must first create the Property, after which you may create the Catalog that is based on it.
E_CAT_PRODUCTID_MULTILINGUAL

[C#] 0x889800E2

[Visual Basic .NET] &H889800E2

The Property that you specified to be used as the ProductID is a Multilingual property. A multilingual property cannot be used as a ProductID for a catalog
E_CAT_INVALID_DATATYPE_FOR_PRODUCTID

[C#] 0x88980075

[Visual Basic .NET] &H88980075

The Property that you specified for the ProductID has a text, enumeration, filepath, float, money, datetime or boolean data type. A property with any of these data type cannot be used as a ProductID for a catalog
E_CAT_CATALOG_EXISTS

[C#] 0x88980001

[Visual Basic .NET] &H88980001

The Catalog name you specified already exists.

Remarks

If variants are to be used in this catalog, you must provide a property name in the optional strProductVariantID parameter. If this parameter is not specified upon creation of the catalog, any attempt to create a product variant in that catalog will fail.

If the strProductID or strProductVariantID parameters are of type cscString, cscEnumeration, or cscFileName, they are limited to a length of 256 characters.

The returned ProductCatalog object will be pre-initialized and ready for use.

This method cannot be called in a transacted object. This method involves the creation, deletion, or updating of free text indexes. SQL Server does not allow these operations in a transaction.

Catalog names, and therefore the strCatalogName parameter, cannot begin with the pound sign (#) and cannot contain any of the following characters:

  • Blank space ( )
  • Double quote (")
  • Comma (,)
  • Period (.)
  • Left square bracket ([)
  • Right square bracket (])

[Visual Basic .NET]

Example

oNewCatalog = myCatalogManager.CreateCatalog( _
  "NewCatalog", "ItemNum", "SKU")

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.DeleteCatalog

CatalogManager3.GetCatalog

Copyright © 2005 Microsoft Corporation.
All rights reserved.