GetHoldingCompany

Returns the member ID of an entity’s HoldingCompany attribute.

Syntax

<HsvEntities>.GetHoldingCompany lItemID, plHoldingCompanyEntityID

Argument

Description

lItemID

Long (ByVal). The member ID of the entity for which you want to get the HoldingCompany attribute.

plHoldingCompanyEntityID

Long. Returns the member ID of the entity specified as the HoldingCompany attribute, or -1 if the entity does not have a holding company.

Example

The following example creates a function that takes an entity’s label and returns either the label of the entity’s holding company or a blank string if the entity has no holding company. The member ID of the entity is obtained with IHsvTreeInfo.GetItemID. This ID is passed to GetHoldingCompany. If GetHoldingCompany returns -1, a blank string is assigned as GetHoldCoLabel’s return value. Otherwise, the ID returned by GetHoldingCompany is passed to IHsvTreeInfo.GetLabel, and the label returned is assigned as GetHoldCoLabel’s return value.

Private Function GetHoldCoLabel(sEnt As String) As String
Dim lEntID As Long, cEntities As HsvEntities, lHoldCoID As Long
Dim cTreeInfo As IHsvTreeInfo, sHoldCoLabel As String
Set cEntities = m_cMetadata.Entities
Set cTreeInfo = m_cMetadata.Entities
lEntID = cTreeInfo.GetItemID(sEnt)
cEntities.GetHoldingCompany lEntID, lHoldCoID
If lHoldCoID = -1 Then
  GetHoldCoLabel = ""
Else
  cTreeInfo.GetLabel lHoldCoID, sHoldCoLabel
  GetHoldCoLabel = sHoldCoLabel
End If
End Function