# MTCounterPropertyDefinition

Defines a priceable item property that requires a counter. (Priceable items that use this object are discounts and usage charges.)

See also MTPriceableItem, MTUsageCharge, MTDiscount.

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

## Program ID

Metratech.MTCounterPropertyDefinition.1

## Methods

Save | This method saves modifications to the database.

## Properties

Properties | Gets all (core and extended) properties of this object by name or collection.
ID | The unique (database) ID.
Name | The name of the counter property for counter mapping (for example, "Qualifier1").
ServiceDefProperty | The name of the service definition property that this counter will be metered into during end-of-period processing (For example, "metratech.com/discount/qualifier1").
Order | The order of the counter as it appears in the list of counters (GUI-related).
DisplayName | The name of the counter property (for example, "Discount Qualifier"). (This is a GUI-related property.)
PreferredCounterTypeName | The counter type name that in most of the cases will be used for this property, for example, "SumOfOneProperty" (GUI-related).
PITypeID | This property specifies the database ID of the priceable item that this Counter Property Definition belongs to.

# Method Detail

## Save

This method saves modifications to the database.

### Visual Basic Syntax

Save() As Long

### C++ Syntax

HRESULT Save([out, retval]long* apDBID);

# Property Detail

## Properties

This property gets all (core and extended) properties of this object by name or collection.

### Visual Basic Syntax

Property Properties As MTProperties

### C++ Syntax

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

## ID

This property specifies the unique (database) ID.

### 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 name of the counter property for counter mapping (for example, "Qualifier1").

### Visual Basic Syntax

Property Name As String

### C++ Syntax

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

HRESULT Name([in] BSTR newVal);

## ServiceDefProperty

This property specifies the name of the service definition property that this counter will be metered into during end-of-period processing (For example, "metratech.com/discount/qualifier1").

### Visual Basic Syntax

Property ServiceDefProperty As String

### C++ Syntax

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

HRESULT ServiceDefProperty([in] BSTR newVal);

## Order

This property specifies the order of the counter as it appears in the list of counters (GUI-related).

### Visual Basic Syntax

Property Order As Long

### C++ Syntax

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

HRESULT Order([in] long newVal);

## DisplayName

The name of the counter property (for example, "Discount Qualifier"). (This is a GUI-related property.)

### Visual Basic Syntax

Property DisplayName As String

### C++ Syntax

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

HRESULT DisplayName([in] BSTR newVal);

## PreferredCounterTypeName

The counter type name that in most of the cases will be used for this property, for example, "SumOfOneProperty" (GUI-related).

### Visual Basic Syntax

Property PreferredCounterTypeName As String

### C++ Syntax

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

HRESULT PreferredCounterTypeName([in] BSTR newVal);

## PITypeID

This property specifies the database ID of the priceable item that this Counter Property Definition belongs to

### Visual Basic Syntax

Property PITypeID As Long

### C++ Syntax

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

HRESULT PITypeID([in] long newVal);

##