# MTPriceableItemType

The type of a priceable item (MTPriceableItem).

To view an object model diagram that includes MTPriceableItemType, click here. To view a diagram that includes this object in the context of rating, click here.

## Program ID

Metratech.MTPriceableItemType.1

## Methods

Save | Saves modifications to the database.
GetParent | If this is a child of a compound type, this method returns the parent type. It returns NULL if there is no parent.
CreateChild | This method creates a priceable item type that is a child of this type. A subsequent Save() of the child will insert it into the database. Note: Setting the ParentID is an alternative to CreateChild() for configuring compound types.
RemoveChild | Removes a child priceable item type.
GetChildren | Returns any child types if this is a compound type, otherwise it returns an empty collection.
GetChild | Returns a child type by its ID.
GetProductOfferings | Returns any product offerings that contain priceable item instances of this priceable item type. Note: This is used to check whether changes to this type affect any present product offerings.
AddParamTableDefinition | Adds a mapping from a parameter table definition to this type.
RemoveParamTableDefinition | Removes mapping from a parameter table definition to this type.
GetParamTableDefinitions | Gets all parameter tables mapped to this type.
RemoveCounterPropertyDefinition | Removes a counter property definition based on its ID.
FindCounterPropertyDefinitionAsRowset | Returns a rowset of all counter property definitions for this type.
GetParamTableDefinitionAsRowset | Gets a rowset of all parameter tables mapped to this type.
GetTemplates | Returns all priceable item templates based on this type.
CreateCounterPropertyDefinition | Creates a counter property definition to for this type. A subsequent Save() on the returned counter property definition will insert it into the database.
RemoveTemplate | Removes a priceable item template by its ID.
CreateTemplate | Creates a priceable item template based on this type. If this a compound type and aCreateChildren is true (or not provided), child templates will be created recursively for all child types. A subsequent Save() on the returned template will insert it into the database.
GetCounterPropertyDefinition | Returns all counter property definitions for this type.

## Properties

Properties | Gets all (core and extended) properties of this object in a collection of MTProperty objects.
ID | The unique (database) ID.
Kind | The kind of priceable item. It can be: PCENTITY_TYPE_USAGE = 10, PCENTITY_TYPE_AGGREGATE_CHARGE = 15, PCENTITY_TYPE_RECURRING = 20, PCENTITY_TYPE_NON_RECURRING = 30, PCENTITY_TYPE_DISCOUNT = 40
Name | The unique name internal to the MT platform.
Description | The description of the Priceable Item.
ServiceDefinition | The fully qualified name of the service definition.
ProductView | The fully qualified name of the product view.
ParentID | If this is a child of a compound type, this is the ID of the parent. Note: Setting the ParentID is an alternative to CreateChild() for configuring compound types.
ConstrainSubscriberCycle | For priceable items that have cycles, this specifies whether the the priceable item's cycle type must be specified for relative cycles. If this boolean property returns true, then the subscriber must have a monthly cycle to subscribe. If false, then a subscriber with any type of billing cycle may subscribe. Example: A percentage discount does not have to be constrained to a particular billing cycle

# Method Detail

## Save

This method saves modifications to the database.

### Visual Basic Syntax

Save()

### C++ Syntax

HRESULT Save();

## GetParent

If this is a child of a compound type, this method returns the parent type. It returns NULL if there is no parent.

### Visual Basic Syntax

GetParent() As MTPriceableItemType

### C++ Syntax

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

## CreateChild

This method creates a priceable item type that is a child of this type. A subsequent Save() of the child will insert it into the database.

Note: Setting the ParentID is an alternative to CreateChild() for configuring compound types.

### Visual Basic Syntax

CreateChild() As MTPriceableItemType

### C++ Syntax

HRESULT CreateChild([out, retval] IMTPriceableItemType** apChildType);

## RemoveChild

This method removes a child priceable item type.

### Visual Basic Syntax

RemoveChild(ID As Long)

### C++ Syntax

HRESULT RemoveChild([in] long aID);

## GetChildren

This method returns any child types if this is a compound type, otherwise it returns an empty collection.

### Visual Basic Syntax

GetChildren() As MTCollection

### C++ Syntax

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

## GetChild

This method returns a child type by its ID.

### Visual Basic Syntax

GetChild(ID As Long) As MTPriceableItemType

### C++ Syntax

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

## AddParamTableDefinition

This method adds a mapping from a parameter table definition to this type.

### Visual Basic Syntax

AddParamTableDefinition(ParamTblDefID As Long)

### C++ Syntax

HRESULT AddParamTableDefinition([in] long aParamTblDefID);

## RemoveParamTableDefinition

This method removes mapping from a parameter table definition to this type.

### Visual Basic Syntax

RemoveParamTableDefinition(ParamTblDefID As Long)

### C++ Syntax

HRESULT RemoveParamTableDefinition([in] long aParamTblDefID);

## GetParamTableDefinitions

This method gets all parameter tables mapped to this type.

### Visual Basic Syntax

GetParamTableDefinitions() As MTCollection

### C++ Syntax

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

## RemoveCounterPropertyDefinition

This method removes a counter property definition based on its ID.

### Visual Basic Syntax

RemoveCounterPropertyDefinition(ID As Long)

### C++ Syntax

HRESULT RemoveCounterPropertyDefinition([in]long aID);

## FindCounterPropertyDefinitionAsRowset

This method returns a rowset of all counter property definitions for this type.

### Visual Basic Syntax

FindCounterPropertyDefinitionsAsRowset(Filter As Variant) As MTRowSet

### C++ Syntax

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

## GetParamTableDefinitionAsRowset

This method gets a rowset of all parameter tables mapped to this type

### Visual Basic Syntax

GetParamTableDefinitionsAsRowset() As MTRowSet

### C++ Syntax

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

## GetTemplates

This method returns all priceable item templates based on this type.

### Visual Basic Syntax

GetTemplates() As MTCollection

### C++ Syntax

HRESULT GetTemplates([out, retval]IMTCollection** apTemplates);

## RemoveTemplate

This Method removes a priceable item template by its ID.

### Visual Basic Syntax

RemoveTemplate(ID As Long)

### C++ Syntax

HRESULT RemoveTemplate([in] long aID);

## CreateTemplate

This method creates a priceable item template based on this type. If this a compound type and aCreateChildren is true (or not provided), child templates will be created recursively for all child types. A subsequent Save() on the returned template will insert it into the database.

### Visual Basic Syntax

CreateTemplate() MTPriceableItem

### C++ Syntax

HRESULT CreateTemplate([out, retval] IMTPriceableItem** apPrcItemTmpl);

## GetCounterPropertyDefinition

This method returns all counter property definitions for this type.

### Visual Basic Syntax

GetCounterPropertyDefinitions() As MTCollection

### C++ Syntax

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

## GetProductOfferings

Returns any product offerings that contain priceable item instances of this priceable item type.

Note: This is used to check whether changes to this type affect any present product offerings.

### Visual Basic Syntax

GetProductOfferings() As MTCollection

### C++ Syntax

HRESULT GetProductOfferings([out, retval) IMTCollection** apProdOffs);

# Property Detail

## Properties

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

### Visual Basic Syntax

Property Properties As MTProperties

### C++ Syntax

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

## ID

This property specifies the unique (database) ID for this object.

### Visual Basic Syntax

Property ID As Long

### C++ Syntax

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

HRESULT ID([in] long newVal);

## Kind

This property denotes the kind of priceable item. It can be:

- PCENTITY_TYPE_USAGE = 10,

- PCENTITY_TYPE_AGGREGATE_CHARGE = 15,

- PCENTITY_TYPE_RECURRING = 20,

- PCENTITY_TYPE_NON_RECURRING = 30,

- PCENTITY_TYPE_DISCOUNT = 40

### Visual Basic Syntax

Property Kind As MTPCEntityType

### C++ Syntax

HRESULT Kind([out, retval] MTPCEntityType *pVal);

HRESULT Kind([in] MTPCEntityType newVal);

## Name

This property specifies the unique name internal to the MT platform.

### Visual Basic Syntax

Property Name As String

### C++ Syntax

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

HRESULT Name([in] BSTR newVal);

## Description

This property specifies the description of the Priceable Item.

### Visual Basic Syntax

Property Description As String

### C++ Syntax

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

HRESULT Description([in] BSTR newVal);

## ServiceDefinition

This property specifies the fully qualified name of the service definition.

### Visual Basic Syntax

Property ServiceDefinition As String

### C++ Syntax

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

HRESULT ServiceDefinition([in] BSTR newVal);

## ProductView

This property specifies the fully qualified name of the product view.

### Visual Basic Syntax

Property ProductView As String

### C++ Syntax

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

HRESULT ProductView([in] BSTR newVal);

## ParentID

If this is a child of a compound type, this property specifies the ID of the parent.

Note: Setting the ParentID is an alternative to CreateChild() for configuring compound types.

### Visual Basic Syntax

Property ParentID As Long

### C++ Syntax

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

HRESULT ParentID([in] long newVal);

## ConstrainSubscriberCycle

For priceable items that have cycles, this property specifies whether the the priceable item's cycle type must be specified for relative cycles.

Example: A percentage discount does not have to be constrained to a particular billing cycle

("it doesn't matter what the billing cycle of the subscriber is")

a flat discount has to be constrained ("Subscriber must have monthly cycle to subscribe")

### Visual Basic Syntax

Property ConstrainSubscriberCycle As Boolean

### C++ Syntax

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

HRESULT ConstrainSubscriberCycle([in] VARIANT_BOOL newVal);