Share via


CreateVirtualCatalog Method (String, String, String)

Creates a new virtual catalog and returns the VirtualCatalog object containing the new catalog.

Namespace:  Microsoft.CommerceServer.Catalog
Assembly:  Microsoft.CommerceServer.Catalog (in Microsoft.CommerceServer.Catalog.dll)

Syntax

'Declaration
Public Function CreateVirtualCatalog ( _
    catalogName As String, _
    defaultLanguage As String, _
    reportingLanguage As String _
) As VirtualCatalog
'Usage
Dim instance As CatalogContext
Dim catalogName As String
Dim defaultLanguage As String
Dim reportingLanguage As String
Dim returnValue As VirtualCatalog

returnValue = instance.CreateVirtualCatalog(catalogName, _
    defaultLanguage, reportingLanguage)
public VirtualCatalog CreateVirtualCatalog(
    string catalogName,
    string defaultLanguage,
    string reportingLanguage
)
public:
VirtualCatalog^ CreateVirtualCatalog(
    String^ catalogName, 
    String^ defaultLanguage, 
    String^ reportingLanguage
)
public function CreateVirtualCatalog(
    catalogName : String, 
    defaultLanguage : String, 
    reportingLanguage : String
) : VirtualCatalog

Parameters

  • catalogName
    Type: System..::.String
    The catalog name. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).
  • defaultLanguage
    Type: System..::.String
    The culture code indicating the default language for the catalog. Should not be nullNothingnullptra null reference (Nothing in Visual Basic).
  • reportingLanguage
    Type: System..::.String
    The reporting language for the catalog. The language to export to the data warehouse.

Return Value

Type: Microsoft.CommerceServer.Catalog..::.VirtualCatalog
A VirtualCatalog containing information about the catalog.

Exceptions

Exception Condition
ArgumentNullException

The catalogName or defaultLanguage is nullNothingnullptra null reference (Nothing in Visual Basic).

ValidationException

One of the input parameters is invalid.

EntityAlreadyExistsException

The catalogName already exists in the catalog system.

NotAuthorizedException

The caller is not authorized to perform this operation.

Remarks

The language is specified as a RFC 1766 CultureInfo class name. If nullNothingnullptra null reference (Nothing in Visual Basic), the language defaults to the current user interface culture. The defaultLanguage is the language that appears when you open the catalog to view it or edit it. The reportingLanguage is the language that will appear on reports.

This method creates a new virtual catalog in the catalog system and returns a VirtualCatalog object. You can call methods on the VirtualCatalog object to access and set information on the catalog. If you make changes to the VirtualCatalog object you should call the Save method to save the changes to the catalog system.

The catalogName should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 85 characters.

  • Not contain the .,"[]'()# characters.

The defaultLanguage should:

  • Not be nullNothingnullptra null reference (Nothing in Visual Basic) or blank.

  • Not exceed 10 characters.

  • Not contain the ,'[] characters.

If specified the reportingLanguage should:

  • Not exceed 10 characters.

  • Not contain the ,'[] characters.

If the reportingLanguage is not specified then the reportingLanguage will be the same as the defaultLanguage.

The newly created Virtual Catalog will have a start date of now and an endDate of three months from now.

Permissions

See Also

Reference

CatalogContext Class

CatalogContext Members

CreateVirtualCatalog Overload

Microsoft.CommerceServer.Catalog Namespace