Returns a Boolean that indicates whether a Custom dimension member is valid for an account.
The valid Custom dimensions for an account are defined by the account’s Custom1TopMember, Custom2TopMember, Custom3TopMember, and Custom4TopMember attributes. |
<HsvMetadata>.IsCustomMemberValidForAccount lDimID, lCustomID, lAccountID, pvbIsValid
Long (ByVal). The number that identifies the Custom dimension to be tested. Use one of the Custom dimension constants listed in Dimension ID Constants. | |
Boolean. Returns TRUE if the Custom dimension member is valid for the account, otherwise FALSE. |
This example tests whether the Custom 1 dimension member named Golf is valid for the AdminExpenses account. GetItemID gets the IDs of the Golf and AdminExpenses members, and the example then passes these IDs to IsCustomMemberValidForAccount. If Golf is a valid Custom 1 member for the AdminExpenses account, then IsCustomMemberValidForAccount sets bIsValid to TRUE, and any code placed within the If structure would be executed.
Dim cTreeInfo As IHsvTreeInfo, lCust1ID As Long, lAcct As Long Dim bIsValid As Boolean 'g_cMetadata is an HsvMetadata object reference Set cTreeInfo = g_cMetadata.Accounts lAcct = cTreeInfo.GetItemID("AdminExpenses") Set cTreeInfo = g_cMetadata.Custom1 lCust1ID = cTreeInfo.GetItemID("Golf") g_cMetadata.IsCustomMemberValidForAccount DIMENSIONCUSTOM1, _ lCust1ID, lAcct, bIsValid If bIsValid = True Then … End If