GetPlugAccount

Returns the member ID of an account’s plug account. In other words, GetPlugAccount returns the member ID of the account that has been defined as an account’s PlugAcct attribute.

Syntax

<HsvAccounts>.GetPlugAccount lAccountID, plPlugAccountID

Argument

Description

lAccountID

Long (ByVal). The member ID of the account for which you want to return the plug account.

plPlugAccountID

Long. Returns the member ID of the plug account.

Example

The following example creates a function that takes an account label and returns the label of the account’s Plug account.

Function GetPlugFromLabel(sAcctLabel As String) As String
Dim cAccounts As HsvAccounts, cTreeInfo As IHsvTreeInfo
Dim lAcctID As Long, lPlugID As Long, sPlugLabel As String
Set cAccounts = m_cMetadata.Accounts
Set cTreeInfo = m_cMetadata.Accounts
lAcctID = cTreeInfo.GetItemID(sAcctLabel)
cAccounts.GetPlugAccount lAcctID, lPlugID
cTreeInfo.GetLabel lPlugID, sPlugLabel
GetPlugFromLabel = sPlugLabel
End Function