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.
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. |
<IHsvTreeInfo>.EnumSortedMembers lListID, lListTopMemberID, lSortOptions, pvaralItemIDs, pvaralParentIDsLong (ByVal). The ID of the member list. You can get member list IDs with GetMemberListID. | |
Long (ByVal). Specifies whether to return all members on the list or only a given member and its descendants. Valid values are described below: | |
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.” 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. | |
Variant. Returns an array of member IDs that are sorted as specified by the lSortOptions argument. | |
Variant. Returns an array of member IDs of the parents of the members returned by the pvaralItemIDs argument. |
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