GetOneCellFromStoredItem

Returns cell information such as a cell’s data and member IDs. You identify the cell with the index number of the subcube item and the member IDs of the cell’s Period and View dimension members. (For details on items, see About Subcube Items.)

Syntax

<HsvNodeCube>.GetOneCellFromStoredItem lHandle, lItem, lPeriod, lView, plValue, plAccount, plICP, plCustom1, plCustom2, plCustom3, plCustom4, pvbDimensionMembersAreValid, pdData, pbyTransType

Argument

Description

lHandle

Long (ByVal) (x86 platform) or Double (x64 platform). The item’s handle. You must pass the handle that was returned by BeginEnumerationOfStoredData.

lItem

Long (ByVal). The index of the item within the count of items returned by BeginEnumerationOfStoredData.

Caution!

This is a zero-based index. For example, if BeginEnumerationOfStoredData returns a count of 5 items, the valid index numbers are 0 through 4.

lPeriod

Long (ByVal). The member ID of the cell’s Period dimension member.

lView

Long (ByVal). The member ID of the cell’s View dimension member.

plValue

Long (ByVal). Returns the member ID of the cell’s Value dimension member.

plAccount

Long. Returns the member ID of the cell’s Account dimension member.

plICP

Long. Returns the member ID of the cell’s Intercompany Partner dimension member.

plCustom1

Long. Returns the member ID of the cell’s Custom 1 dimension member.

plCustom2

Long. Returns the member ID of the cell’s Custom 2 dimension member.

plCustom3

Long. Returns the member ID of the cell’s Custom 3 dimension member.

plCustom4

Long. Returns the member ID of the cell’s Custom 4 dimension member.

pvbDimensionMembersAreValid

Boolean. Indicates whether the cell is valid or obsolete. Returns TRUE if valid, FALSE if obsolete.

An obsolete cell can exist in cases where metadata has been changed and data has been loaded in merge mode. For performance reasons, Financial Management does not delete obsolete cells from the database.

Tip:

To perform operations with only data for valid cells, test this argument for TRUE.

pdData

Double. Returns the cell’s data.

pbyTransType

Byte. Returns the cell’s transaction status. For a list of HFMConstants type library constants that represent the valid statuses, see Cell Transaction Type Constants.

Example

The following example prints the Account labels and data of valid cells to Visual Basic’s Immediate window. BeginEnumerationOfStoredData returns the number of items, and the example then loops through these items with GetOneCellFromStoredItem. If GetOneCellFromStoredItem’s pvbDimensionMembersAreValid argument returns TRUE, the cell is valid and the example prints the information to the Immediate window. Once the loop ends, EndEnumerationOfStoredData unlocks the subcube.

Note:

The example assumes an x86 platform, and that the member IDs passed to GetNodeCube and GetOneCellFromStoredItem are obtained from another procedure.

Dim cHsvNodeCube As HsvNodeCube, lItems As Long
Dim lAcctID As Long, lIcpID As Long, lCust1ID As Long
Dim lCust2ID As Long, lCust3ID As Long, lCust4ID As Long
Dim dData As Double, bytTrans As Byte
Dim cIHsvTreeInfo As IHsvTreeInfo, sAcctLabel As String
Dim lHandle As Long, lValID As Long, bValid As Boolean
m_cHsvData.GetNodeCube m_lScen, m_lYear, m_lEnt, m_lPar, _ 
cHsvNodeCube
cHsvNodeCube.BeginEnumerationOfStoredData m_lVal, lHandle, _ 
lItems
Set cIHsvTreeInfo = m_cHsvMetadata.Accounts
For i = 0 To lItems - 1
  cHsvNodeCube.GetOneCellFromStoredItem lHandle, i, m_lPer, _ 
  m_lView, lValID, lAcctID, lIcpID, lCust1ID, lCust2ID, _ 
  lCust3ID, lCust4ID, bValid, dData, bytTrans
  If bValid = True Then
    cIHsvTreeInfo.GetLabel lAcctID, sAcctLabel
    Debug.Print sAcctLabel & ": " & CStr(dData)
  End If
Next i
cHsvNodeCube.EndEnumerationOfStoredData lHandle