Public Sub AttributeTableEntries()

   

   Dim oService As REServices

   Set oService = New REServices

   oService.Init REApplication.SessionContext



   Dim oAttributeServer As CAttributeTypeServer

   Set oAttributeServer = oService.CreateServiceObject(bbsoAttributeTypeServer)

   oAttributeServer.Init REApplication.SessionContext

   

   Dim lAttributeID As Long

   'The below gets the attribute ID for the Committees attribute

   lAttributeID = oAttributeServer.GetAttributeTypeID("Committees", bbAttributeRecordType_CONSTITUENT)

          

   Dim lTableID As Long

   'The below gets the table ID for the Committees attribute based on the attribute ID

   lTableID = oAttributeServer.GetAttributeCodeTableID(lAttributeID)

   

   Dim oTEs As CTableEntries

   Set oTEs = New CTableEntries

   oTEs.Init REApplication.SessionContext, lTableID

   

   Dim oTE As CTableEntry

   

   For Each oTE In oTEs

       'The below outputs the table entry long description and the active flag

       'Entries with a -1 for the active flag are active and entries with a 0 are inactive

       Debug.Print oTE.Fields(tableentry_fld_LONGDESCRIPTION) & "  " & oTE.Fields(tableentry_fld_ACTIVE)

       oTE.CloseDown

   Next oTE

  

  'Clean up

   Set oAttributeServer = Nothing

   

   oService.CloseDown

   Set oService = Nothing

   

   oTEs.CloseDown

   Set oTEs = Nothing

   

   Set oTE = Nothing

   

End Sub

Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.