# MTProductCatalog

This is the top level interface to the product catalog.

To view a a rate-related object model diagram that includes MTProductCatalog, click here. For a priceable item-related diagram, click here.

## Program ID

Metratech.MTProductCatalog.1

## Methods

--configuration methods--
GetMetaData | Returns meta data for a product catalog business object.
GetPriceListChaining | Gets currently configured price list chaining.
IsBusinessRuleEnabled | This method tests whether a business rule currently enabled.
--priceable item type methods--
GetPriceableItemType | Returns a priceable item type given its ID.
GetPriceableItemTypes | Returns all priceable item types.
GetPriceableItemByName | Returns a priceable item type given its name.
RemovePriceableItemType | Removes a priceable item type given its ID. Note: This method will fail if there are priceable item templates for that type.
CreatePriceableItemType | Creates a priceable item type. A subsequent Save() on the returned type will insert it into the database.
--parameter table definition methods--
GetParamTableDefinition | Finds a parameter table definition by its ID.
GetParamTableDefinitionByName | Finds a parameter table definition by its name.
--calendar methods--
CreateCalendar | Creates a calendar (MTCalendar). a subsequent Save() on the returned calendar will insert it into the database.
GetCalendar | Returns a calendar given its ID.
GetCalendarByName | Retrieve calendar by its name.
GetCalendarsAsRowset | Returns all calendar parameter tables.
--priceable item methods--
GetPriceableItem | Finds a priceable item of any kind by its ID.
GetPriceableItemTypeByName | Returns a priceable item type by its name.
FindPriceableItemsAsRowset | Returns a rowset of priceable item templates.
GetPriceableItemInstancesByKind | Returns all priceable item instances of a given kind.
RateAllAggregateCharges | Rates all aggregate charges for a usage interval.
RateAllAggregateChargesForAccount | Rates all aggregate charges for a usage interval and account.
RateAllAggregateChargesForAccountAsynch | Rates all aggregate charges for a usage interval and account. Note: This method does not wait for sessions to commit before returning.
--pricelist methods--
CreatePriceList | Creates a new price list. A subsequent MTPriceList::Save() will insert it into the database.
GetPriceList | Finds a price list by its ID.
GetPriceListByName | Finds a price list by its name.
FindPriceListsForMappingAsRowset | Returns a rowset of all price lists with an additional column 'rateschedules'. The column 'rateschedules' contains the number of rate schedules for that price list.
RemovePriceList | Removes a price list from the database.
FindPriceListsAsRowset | Returns a rowset of price lists
--product offering methods--
FindProductOfferingsAsRowset | Returns a rowset of product offerings.
CreateProductOffering | Creates a new product offering. A subsequent MTProductOffering::Save() will insert it into the database.
RemoveProductOffering | Removes a product offering from the database.
GetProductOffering | Finds a product offering by its ID.
GetProductOfferingByName | Finds a product offering by its name.
--account methods--
GetAccount | Return a MTPCAccount given its ID.
BulkSubscriptionChange | Moves all subscribers from one product offering to another on a given date.
--counters methods--
GetCountersOfType | Returns all counters of a given counter type.
CreateCounter | Creates a counter for a given counter type.
FindCountersAsRowset | Returns a rowset of all counters.
GetCounterType | Returns a counter type given its ID.
GetCounterTypeByName | Returns a counter type given its name.
GetCounterTypes | Returns a counter type given its ID.
GetCounter | Returns a counter given its ID.
GetCounterPropertyDefinition | Returns a counter property definition given its ID. Note: Methods to create and remove counter property definitions are contained in the priceable item type.
RemoveCounter | Removes a counter given its ID.

## Properties

None.

# Method Detail

## GetPriceableItemType

This method returns a priceable item type given its ID.

### Visual Basic Syntax

GetPriceableItemType(ID As Long) As MTPriceableItemType

### C++ Syntax

HRESULT GetPriceableItemType([in] long aID, [out, retval] IMTPriceableItemType** apType);

## GetPriceableItemTypes

This method returns all priceable item types.

### Visual Basic Syntax

GetPriceableItemTypes(Filter As Variant) As MTCollection

### C++ Syntax

HRESULT GetPriceableItemTypes([in, optional] VARIANT aFilter, [out, retval] IMTCollection** apColl);

## GetPriceableItem

This method returns a priceable item template or instance given its ID.

### Visual Basic Syntax

GetPriceableItemType(ID As Long) At MTPriceableItemType

### C++ Syntax

HRESULT GetPriceableItemType([in] long aID, [out, retval] IMTPriceableItemType** apType);

## RemovePriceableItemType

This method removes a priceable item type given its ID.

Note: This method will fail if there are priceable item templates for that type.

### Visual Basic Syntax

RemovePriceableItemType(ID As Long)

### C++ Syntax

HRESULT RemovePriceableItemType([in] long aID);

## CreatePriceableItemType

This method creates a priceable item type. A subsequent Save() on the returned type will insert it into the database.

### Visual Basic Syntax

CreatePriceableItemType() As MTPriceableItemType

### C++ Syntax

HRESULT CreatePriceableItemType([out, retval] IMTPriceableItemType** apType);

## BulkSubscriptionChange

This method moves all subscribers from one product offering to another on a given date.

### Visual Basic Syntax

BulkSubscriptionChange(OldPO_id As Long, NewPO_id As Long, Date As Variant, bNextBillingCycle As Boolean)

### C++ Syntax

HRESULT BulkSubscriptionChange([in] long aOldPO_id,[in] long aNewPO_id,[in] VARIANT vtDate,[in] VARIANT_BOOL bNextBillingCycle);

## GetMetaData

This method returns meta data for a product catalog business object.

### Visual Basic Syntax

GetMetaData(EntityType As MTPCEntityType) As MTPropertyMetaDataSet

### C++ Syntax

HRESULT GetMetaData([in] MTPCEntityType aEntityType, [out, retval] IMTPropertyMetaDataSet ** apMetaDataSet);

## CreateProductOffering

This method creates a new product offering. A subsequent MTProductOffering::Save() will insert it into the database.

### Visual Basic Syntax

CreateProductOffering() As MTProductOffering

### C++ Syntax

HRESULT CreateProductOffering([out, retval] IMTProductOffering** apProdOff);

## CreatePriceList

This method creates a new price list A subsequent MTPriceList::Save() will insert it into the database.

### Visual Basic Syntax

CreatePriceList() As MTPriceList

### C++ Syntax

HRESULT CreatePriceList([out, retval] IMTPriceList * * apPriceList);

## RemoveProductOffering

This method removes a product offering from the database.

### Visual Basic Syntax

RemoveProductOffering(ID As Long)

### C++ Syntax

HRESULT RemoveProductOffering([in] long aID);

## RemovePriceList

This method removes a price list from the database.

### Visual Basic Syntax

RemovePriceList(ID As Long)

### C++ Syntax

HRESULT RemovePriceList(long id);

## GetPriceableItem

This method finds a priceable item of any kind by its name.

### Visual Basic Syntax

GetPriceableItemInstancesByKind(Kind As MTPCEntityType) As MTCollection

### C++ Syntax

HRESULT GetPriceableItemInstancesByKind( [in] MTPCEntityType aKind, [out, retval] IMTCollection** apInstances);

## GetPriceableItemByName

This method finds a priceable item of any kind by its name.

### Visual Basic Syntax

GetPriceableItemByName(Name As String) As MTPriceableItem

### C++ Syntax

HRESULT GetPriceableItemByName([in] BSTR aName, [out, retval] IMTPriceableItem * * apPI);

## GetProductOffering

This method finds a product offering by its ID.

### Visual Basic Syntax

GetProductOffering(ID As Long) As MTProductOffering

### C++ Syntax

HRESULT GetProductOffering([in] long ID, [out, retval] IMTProductOffering**);

## GetProductOfferingByName

This method finds a product offering by its name.

### Visual Basic Syntax

GetProductOfferingByName(Name As String) As MTProductOffering

### C++ Syntax

HRESULT GetProductOfferingByName([in] BSTR aName, [out, retval] IMTProductOffering**);

## GetPriceList

This method finds a price list by its ID.

### Visual Basic Syntax

GetPriceList(ID as Long) As MTPriceList

### C++ Syntax

HRESULT GetPriceList(long id, [out, retval] IMTPriceList * * apPriceList);

## GetPriceListByName

This method finds a price list by its name.

### Visual Basic Syntax

GetPriceListByName(Name As String) As MTPriceList

### C++ Syntax

HRESULT GetPriceListByName([in] BSTR aName, [out, retval] IMTPriceList * * apPriceList);

## GetParamTableDefinition

This method finds a parameter table definition by its ID.

### Visual Basic Syntax

GetParamTableDefinition(ID As Long) As MTParamTableDefinition

### C++ Syntax

HRESULT GetParamTableDefinition(long id, [out, retval] IMTParamTableDefinition * * table);

## GetParamTableDefinitionByName

This method finds a parameter table definition by its name.

### Visual Basic Syntax

GetParamTableDefinitionByName(Name As String) As MTParamTableDefinition

### C++ Syntax

HRESULT GetParamTableDefinitionByName(BSTR name, [out, retval] IMTParamTableDefinition * * table);

## FindPriceableItemsAsRowset

This method returns a rowset of priceable item templates.

### Visual Basic Syntax

FindPriceableItemsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindPriceableItemsAsRowset([in, optional] VARIANT aFilter, [out, retval] IMTRowSet** apRowset);

## FindProductOfferingsAsRowset

This method returns a rowset of product offerings.

### Visual Basic Syntax

FindProductOfferingsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindProductOfferingsAsRowset([in, optional] VARIANT aFilter, [out, retval] IMTRowSet** apRowset);

## FindPriceListsForMappingAsRowset

This method returns a rowset of all price list with an additional column 'rateschedules'. The column 'rateschedules' contains the number of rate schedules for that price list.

and passed in parameter table definition and priceable item template

### Visual Basic Syntax

FindPriceListsForMappingAsRowset(ParamTblDefID As Long, PrcItemTmplID As Long, Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindPriceListsForMappingAsRowset([in] long aParamTblDefID, [in] long aPrcItemTmplID, [in, optional] VARIANT aFilter, [out, retval] IMTRowSet** apRowset);

## FindPriceListsAsRowset

This method returns a rowset of price lists

### Visual Basic Syntax

FindPriceListsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindPriceListsAsRowset([in, optional] VARIANT aFilter, [out, retval] IMTRowSet** apRowset);

## FindCountersAsRowset

This method returns a rowset of all counters.

### Visual Basic Syntax

FindPriceListsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

HRESULT FindPriceListsAsRowset([in, optional] VARIANT aFilter, [out, retval] IMTRowSet** apRowset);

## GetCounterType

This method returns a counter type given its ID.

### Visual Basic Syntax

GetCounterType(DBID As Long) As MTCounterType

### C++ Syntax

HRESULT GetCounterType([in]long aDBID, [out, retval]IMTCounterType** apVal);

## GetCounterTypeByName

This method returns a counter type given its name.

### Visual Basic Syntax

GetCounterTypeByName(CounterTypeName As String) As MTCounterType

### C++ Syntax

HRESULT GetCounterTypeByName([in]BSTR aCounterTypeName, [out, retval]IMTCounterType** apVal);

## GetCounterTypes

This method returns a counter type given its ID.

### Visual Basic Syntax

GetCounterTypes() As MTCollection

### C++ Syntax

HRESULT GetCounterTypes([out, retval]IMTCollection** apColl);

## GetCounter

This method returns a counter given its ID.

### Visual Basic Syntax

GetCounter(DBID As Long) As MTCounter

### C++ Syntax

HRESULT GetCounter([in]long aDBID, [out, retval]IMTCounter** apCounter);

## GetCountersOfType

This method returns all counters of a given counter type.

### Visual Basic Syntax

GetCountersOfType()

### C++ Syntax

HRESULT GetCountersOfType([in]long aTypeDBID, [out, retval]IMTCollection** apColl);

## CreateCounter

This method creates a counter for a given counter type.

### Visual Basic Syntax

CreateCounter(TypeID As Long) As MTCounter

### C++ Syntax

HRESULT CreateCounter([in]long aTypeID, [out, retval]IMTCounter** apCounter);

## RateAllAggregateCharges

This method rates all aggregate charges for a usage interval.

### Visual Basic Syntax

RateAllAggregateChargesForAccount(UsageIntervalID As Long, AccountID As Long)

### C++ Syntax

RateAllAggregateChargesForAccount(long aUsageIntervalID, long aAccountID);

## RateAllAggregateChargesForAccount

This method rates all aggregate charges for a usage interval and account.

### Visual Basic Syntax

RateAllAggregateChargesForAccount(UsageIntervalID As Long, AccountID As Long)

### C++ Syntax

HRESULT RateAllAggregateChargesForAccount(long aUsageIntervalID, long aAccountID);

## RateAllAggregateChargesForAccountAsynch

### Visual Basic Syntax

RateAllAggregateChargesForAccountAsynch(UsageIntervalID As Long, AccountID As Long)

### C++ Syntax

HRESULT RateAllAggregateChargesForAccountAsynch(long aUsageIntervalID, long aAccountID);

## GetPriceableItemInstancesByKind

This method returns all priceable item instances of a given kind.

### Visual Basic Syntax

GetPriceableItemInstancesByKind(Kind As MTPCEntityType) As MTCollection

### C++ Syntax

HRESULT GetPriceableItemInstancesByKind( [in] MTPCEntityType aKind, [out, retval] IMTCollection** apInstances);

## GetCalendarsAsRowset

This method returns all calendar parameter tables.

### Visual Basic Syntax

GetCalendarsAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetCalendarsAsRowset([out, retval] IMTRowSet ** apRowset);

## GetCalendar

This method returns a calendar given its ID.

### Visual Basic Syntax

GetCalendar(ID As Long) As MTCalendar

### C++ Syntax

HRESULT GetCalendar([in] long aID, [out, retval] IMTCalendar ** apCalendar);

## GetCalendarByName

This method retrieves a calendar by its name.

### Visual Basic Syntax

Function GetCalendarByName(aName As String) As MTCalendar

### C++ Syntax

HRESULT GetCalendarByName([in] BSTR aName, [out, retval] IMTCalendar ** apCalendar);

## GetPriceListChaining

This method gets currently configured price list chaining.

### Visual Basic Syntax

GetPricelistChaining() As MTPC_PRICE LIST_CHAIN_RULE

### C++ Syntax

HRESULT GetPricelistChaining([out, retval]MTPC_PRICE LIST_CHAIN_RULE* apChainRule);

## IsBusinessRuleEnabled

This method tests whether a business rule currently enabled.

### Visual Basic Syntax

IsBusinessRuleEnabled(BusRule As MTPC_BUSINESS_RULE, EnabledFlag As Boolean)

### C++ Syntax

HRESULT IsBusinessRuleEnabled([in]MTPC_BUSINESS_RULE aBusRule,[out, retval]VARIANT_BOOL* apEnabledFlag);

## GetPriceableItemTypeByName

This method returns a priceable item type by its name.

### Visual Basic Syntax

GetPriceableItemTypeByName(Name As String) As MTPriceableItemType

### C++ Syntax

HRESULT GetPriceableItemTypeByName([in] BSTR aName,[out,retval] IMTPriceableItemType** apType);

## CreateCalendar

Creates a calendar (MTCalendar). a subsequent Save() on the returned calendar will insert it into the database.

### Visual Basic Syntax

CreateCalendar() As MTCalendar

### C++ Syntax

HRESULT CreateCalendar([out, retval] IMTCalendar ** apCalendar);

## GetAccount

This method returns a MTPCAccount given its ID.

### Visual Basic Syntax

GetAccount(ID As Long) As MTPCAccount

### C++ Syntax

HRESULT GetAccount([in] long accountID,[out,retval] IMTPCAccount** ppAccount);

## GetCounterPropertyDefinition

This method returns a counter property definition given its ID.

Note: Methods to create and remove counter property definitions are contained in the priceable item type.

### Visual Basic Syntax

GetCounterPropertyDefinition(DBID As Long) As MTCounterPropertyDefinition

### C++ Syntax

HRESULT GetCounterPropertyDefinition([in]long aDBID, [out, retval]IMTCounterPropertyDefinition** apCPD);

## RemoveCounter

This method removes a counter given its ID.

### Visual Basic Syntax

RemoveCounter(CounterID As Long)

### C++ Syntax

HRESULT RemoveCounter([in]long aCounterID);