# MTProductOffering

A subscribable grouping of priceable items.

To view an object model diagram that includes MTProductOffering, click here.

## Program ID

Metratech.MTProductOffering.1

## Methods

Save | Saves modifications to this product offering in the database.
CheckConfiguration | Checks to see if a product offering is completely configured. This is called before making product offering available. The collection will return empty if the product offering is correctly configured. Otherwise, it returns a collection of error strings.
CreateCopy | Creates a copy of this product offering. The copy contains the same priceable items, but has empty dates. CreateCopy saves the new product offering in the database with the new name. The copy includes the product offering's price list mappings. The copy does not exist in the database until a subsequent call to Save().
AddPriceableItem | Adds a priceable item template (of any kind) to this product offering. If this product offering has not yet been created, the priceable item is added in memory. It will be added to the database when save is called for the product offering. If this product offering has already been created, the priceable item is added to the database immediately. The priceable item instance is a copy of the template passed in. All properties are initially the same.
RemovePriceableItem | Removes a priceable item instance (of any kind) from this product offering.
GetCountOfActiveSubscriptions | Returns the number of currently active subscriptions.
GetPriceableItem | Gets a priceable item belonging to this product offering by its ID.
GetPriceableItemByName | Gets a PriceableItem of this PO by its name.
GetPriceableItems | Gets all PriceableItems belonging to this product offering.
GetPriceableItemsAsRowset | Returns a rowset of priceable items.
GetCurrencyCode | Returns the currency code of this product offering, or "" (null) if the currency is not yet determined. Note: The Currency is determined by the currency of the price list used in the first price list mapping. All price list mappings within a product offering must use price lists of the same currency.
CanBeModified | If true, a user can modify a product offering (for example, remove priceable items).
HasAvailabilityDateBeenSet | This method returns true if the availability start date of this product offering has been set (to an non-empty value).
RateAllAggregateChargesForAccountAsynch | Rates all aggregate charges for a usage interval. Note: Account does not wait for sessions to commit before returning.

## Properties

Properties | Returns all (core and extended) properties of this object as a collection of MTProperty objects.
ID | Unique (database) ID of this product offering.
Name | Internal name of the product offering.
DisplayName | The name shown to the user.
Description | Description of the product offering.
SelfSubscribable | If true, users can self subscribe to this product offering through MPS.
SelfUnsubscribable | If true, users can cancel subscriptions to this product offering through MPS.
EffectiveDate | Time span during which this product offering can be used.
AvailabilityDate | Time span during which this product offering is available for subscription.

# Method Detail

## Save

This method saves modifications to this product offering in the database.

### Visual Basic Syntax

Save()

### C++ Syntax

HRESULT Save();

## CheckConfiguration

This method checks to see if a product offering is completely configured. This is called before making product offering available.

- The collection will return empty if the product offering is correctly configured.

- Otherwise, it returns a collection of error strings.

### Visual Basic Syntax

CheckConfiguration() As MTCollection

### C++ Syntax

HRESULT CheckConfiguration([out, retval] IMTCollection** apErrors);

## CreateCopy

Creates a copy of this product offering; the copy is saved with the specified name (aNewName) passed as an argument. The copy contains the same priceable items, but has empty dates. CreateCopy saves the new product offering in the database with the new name. The copy includes the product offering's price list mappings.

### Visual Basic Syntax

CreateCopy(aNewName as String) As MTProductOffering

### C++ Syntax

HRESULT CreateCopy(BSTR aNewName, [out, retval] IMTProductOffering** apProdOff);

### Arguments

aNewName - name of the Product Offering to create

## AddPriceableItem

This method adds a priceable item template (of any kind) to this product offering.

If this product offering has not yet been created, the priceable item is added in memory. It will be added to the database when save is called for the product offering.

If this product offering has already been created, the priceable item is added to the database immediately. The priceable item instance is a copy of the template passed in. All properties are initially the same.

### Visual Basic Syntax

AddPriceableItem(PrcItemTmpl As MTPriceableItem) As MTPriceableItem

### C++ Syntax

HRESULT AddPriceableItem([in] IMTPriceableItem* apPrcItemTmpl, [out, retval] IMTPriceableItem** apPrcItemInstance);

## RemovePriceableItem

This method removes a priceable item instance (of any kind) from this product offering.

### Visual Basic Syntax

RemovePriceableItem(PrcItemInstanceID As Long)

### C++ Syntax

HRESULT RemovePriceableItem([in] long aPrcItemInstanceID);

## GetCountOfActiveSubscriptions

This method returns the number of currently active subscriptions.

### Visual Basic Syntax

GetCountOfActiveSubscriptions(SubCount As Long)

### C++ Syntax

HRESULT GetCountOfActiveSubscriptions([out, retval] long* apSubCount);

## GetPriceableItem

This method gets a priceable item belonging to this product offering by its ID.

### Visual Basic Syntax

GetPriceableItemByName(Name As String) As MTPriceableItem

### C++ Syntax

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

### Arguments

aName - name of the PriceableItem instance

### Returns

The PriceableItem instance or NULL if not found

## GetPriceableItemByName

This method gets a PriceableItem of this PO by its name.

### Visual Basic Syntax

GetPriceableItemByName(Name As String) As MTPriceableItem

### C++ Syntax

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

## GetPriceableItems

This method gets all PriceableItems belonging to this product offering.

### Visual Basic Syntax

GetPriceableItems() As MTCollection

### C++ Syntax

HRESULT GetPriceableItems([out, retval] IMTCollection**);

## GetPriceableItemsAsRowset

This method returns a rowset of priceable items.

### Visual Basic Syntax

GetPriceableItemsAsRowset() As MTRowSet

### C++ Syntax

HRESULT GetPriceableItemsAsRowset([out, retval] IMTRowSet**);

## CanBeModified

If this returns true, a user can modify a product offering (for example, remove priceable items).

### Visual Basic Syntax

CanBeModified(Errors As Variant) As Boolean

### C++ Syntax

HRESULT CanBeModified([out, optional] VARIANT* apErrors, [out, retval] VARIANT_BOOL *pVal);

## GetCurrencyCode

Returns the currency code of this product offering, or "" (null) if the currency is not yet determined.

Note: The Currency is determined by the currency of the price list used in the first price list mapping. All price list mappings within a product offering must use price lists of the same currency.

### Visual Basic Syntax

GetCurrencyCode() As String

### C++ Syntax

HRESULT GetCurrencyCode([out, retval] STR* apCurrency);

## RateAllAggregateChargesForAccountAsynch

This method rates all aggregate charges for a usage interval.

Note: Account does not wait for sessions to commit before returning.

### Visual Basic Syntax

RateAllAggregateChargesForAccountAsynch(UsageIntervalID As Long, AccountID As Long)

### C++ Syntax

RateAllAggregateChargesForAccountAsynch(long aUsageIntervalID, long aAccountID);

## HasAvailabilityDateBeenSet

This method returns true if the availability start date of this product offering has been set (to an non-empty value).

### Visual Basic Syntax

HasAvailabilityDateBeenSet() As Variant

### C++ Syntax

HRESULT HasAvailabilityDateBeenSet([out, retval] VARIANT_BOOL *apHasBeenSet);

# Property Detail

## Properties

This property returns all (core and extended) properties of this object as a collection of MTProperty objects.

### Visual Basic Syntax

Property Properties As MTProperties

### C++ Syntax

HRESULT Properties([out, retval] IMTProperties **pVal);

## ID

This property specifies a unique ID of this product offering.

### Visual Basic Syntax

Property ID as Long

### C++ Syntax

HRESULT ID([out, retval] long *pVal);

HRESULT ID([in] long newVal);

## Name

This property specifies the internally used MT platform name of the product offering.

### Visual Basic Syntax

Property Name As String

### C++ Syntax

HRESULT Name([out, retval] BSTR *pVal);

HRESULT Name([in] BSTR newVal);

## DisplayName

This property establishes the name shown to the user.

### Visual Basic Syntax

Property DisplayName As String

### C++ Syntax

HRESULT DisplayName([out, retval] BSTR *pVal);

HRESULT DisplayName([in] BSTR newVal);

## Description

This property establishes the description of the product offering.

### Visual Basic Syntax

Property Description As String

### C++ Syntax

HRESULT Description([out, retval] BSTR *pVal);

HRESULT Description([in] BSTR newVal);

## SelfSubscribable

If this boolean property is true, users can self subscribe to this product offering. through MPS.

### Visual Basic Syntax

Property SelfSubscribable As Boolean

### C++ Syntax

HRESULT SelfSubscribable([out, retval] VARIANT_BOOL *pVal);

HRESULT SelfSubscribable([in] VARIANT_BOOL newVal);

## SelfUnsubscribable

If this boolean property is true, users can cancel subscriptions for this product offering through MPS.

### Visual Basic Syntax

Property SelfUnsubscribable As Boolean

### C++ Syntax

HRESULT SelfUnsubscribable([out, retval] VARIANT_BOOL *pVal);

HRESULT SelfUnsubscribable([in] VARIANT_BOOL newVal);

## EffectiveDate

This property establishes a time span during which this product offering can be used.

### Visual Basic Syntax

Property EffectiveDate As MTPCTimeSpan

### C++ Syntax

HRESULT EffectiveDate([out, retval] IMTPCTimeSpan **pVal);

## AvailabilityDate

This property establishes a time span during which this product offering is available for subscription.

### Visual Basic Syntax

property AvailabilityDate As MTPCTimeSpan

### C++ Syntax

HRESULT AvailabilityDate([out, retval] IMTPCTimeSpan **pVal);