GetSettingsICPeriods

Returns the period status, matching tolerance, and Match/Validate Before Post settings of multiple periods for a scenario and year.

Note:

To return these settings for a single period, use GetSettingsICPeriod.

Syntax

<IHsvAdminICM>.GetSettingsICPeriods(lScenario, lYear, varalPeriods)

Argument

Description

lScenario

Long (ByVal). The member ID of the Scenario dimension member.

lYear

Long (ByVal). The member ID of the Year dimension member.

varalPeriods

Long array (ByVal). The member IDs of the Period dimension members.

Return Value

Variant. Returns a multidimensional array of the settings for each period. The first dimension contains four items that represent the period settings, and the second dimension contains one item for each specified period. The following table describes the first dimension:

Index

Description

0

Long. Returns the member ID of the Period dimension member to which the settings apply.

1

Byte. Returns the period’s status. Valid values are represented by the HFMConstants type library constants listed in Period Status Constants.

2

Byte. Returns the period’s Match/Validate Before Post setting. Valid values are represented by the HFMConstants type library constants listed in Match/Validate Before Post Constants.

3

Double. Returns the matching tolerance specified for the period.

Example

The following snippet populates a user-defined type with the settings returned by GetSettingsICPeriods. The period labels, statuses, and Match/Validate Before Post settings are converted to strings before being added to the type. Following is the type declaration:

Public Type perSettings
  sPeriod As String
  sStatus As String
  sMatchValidate As String
  dTolerance As Double
End Type

The example assumes that the variables containing the Scenario, Year, and Period member IDs have been populated.

Dim cAdminICM As IHsvAdminICM, cTreeInfo As IHsvTreeInfo
Dim vaRet As Variant, udtSetting() As perSettings
'laPers() is a previously-defined array of Period member IDs
ReDim udtSetting(UBound(laPers))
'g_cSession is an HsvSession object reference
Set cAdminICM = g_cSession.ICM
'g_cMetadata is an HsvMetadata object reference
Set cTreeInfo = g_cMetadata.Periods
'dimension member IDs have already been defined
vaRet = cAdminICM.GetSettingsICPeriods(lScen, lYear, laPers)
For i = LBound(vaRet, 2) To UBound(vaRet, 2)
   cTreeInfo.GetLabel vaRet(0, i), udtSetting(i).sPeriod
   Select Case vaRet(1, i)
    Case ICM_CLOSED
      udtSetting(i).sStatus = "Closed"
    Case ICM_OPENED
      udtSetting(i).sStatus = "Open"
    Case ICM_UNOPENED
      udtSetting(i).sStatus = "Unopened"
   End Select
   If vaRet(2, i) = ICM_MVBP_OFF Then
     udtSetting(i).sMatchValidate = "Off"
   Else
     udtSetting(i).sMatchValidate = "On"
   End If
   udtSetting(i).dTolerance = vaRet(3, i)
Next i