EnumSortedMembers

Returns an array containing the member IDs of the Intercompany Partner dimension members in a member list, with the members sorted according to the specified sorting criteria.

Note:

For dimensions other than Intercompany Partner, EnumSortedMembers behaves like EnumMembers in that it returns members on the specified member list but does not sort them.

Syntax

<IHsvTreeInfo>.EnumSortedMembers lListID, lListTopMemberID, lSortOptions, pvaralItemIDs, pvaralParentIDs

Argument

Description

lListID

Long (ByVal). The ID of the member list.

Tip:

You can get member list IDs with GetMemberListID.

lListTopMemberID

Long (ByVal). Specifies whether to return all members on the list or only a given member and its descendants. Valid values are described below:

  • To return all members, pass the HFMConstants type library constant MEMBERNOTUSED.

  • To return only a given member and its descendants, pass the member ID of the member.

lSortOptions

Long (ByVal). The member information by which to sort. You can pass any combination of the HFMConstants type library constants that are listed in Metadata Information Constants and that include the word “SORT.”

Note:

By default, EnumSortedMembers sorts in ascending order, so there in no constant for ascending order.

You can specify multiple sorting options by using the Or operator with these constants.

pvaralItemIDs

Variant. Returns an array of member IDs that are sorted as specified by the lSortOptions argument.

pvaralParentIDs

Variant. Returns an array of member IDs of the parents of the members returned by the pvaralItemIDs argument.

Example

The following example prints to Visual Basic’s Immediate window the labels of the [ICP Entities] Intercompany Partner member and its descendants on the [Hierarchy] member list. The labels are sorted in ascending order.

Dim cTreeInfo As IHsvTreeInfo, lTopId As Long
Dim lListId As Long, sLabel As String, vaChildren As Variant
Dim vaParents As Variant
'g_cMetadata is a previously set HsvMetadata object reference
Set cTreeInfo = g_cMetadata.ICPs
lTopId = cTreeInfo.GetItemID("[ICP Entities]")
cTreeInfo.GetMemberListID "[Hierarchy]", lListId
cTreeInfo.EnumSortedMembers lListId, lTopId, WEBOM_METADATA_INFO_SORTBY_LABEL, _
  vaChildren, vaParents
For i = LBound(vaChildren) To UBound(vaChildren)
  cTreeInfo.GetLabel vaChildren(i), sLabel
  Debug.Print sLabel
Next i