Public Sub AddConstituentAttribute()

  Dim orec As CRecord

  Set orec = New CRecord

  orec.Init REApplication.SessionContext

  

  Dim oAttSer As CAttributeTypeServer

  Set oAttSer = New CAttributeTypeServer

  oAttSer.Init REApplication.SessionContext

  

  Dim lAddid As Long

  'Get the ID of the attribute to be added

  lAddid = oAttSer.GetAttributeTypeID("StaffManager", bbAttributeRecordType_CONSTITUENT)

   

  'Load the constituent

  orec.Load 187

  

  Dim oAtt As IBBAttribute

  

   With orec.Attributes.Add

       'Add the constituent

       .Fields(Attribute_fld_ATTRIBUTETYPES_ID) = lAddid

       'Value is the SystemID of the Constituent that is to be the attribute

       .Fields(Attribute_fld_VALUE) = 280

   End With

   

   orec.Save

   orec.CloseDown

   Set orec = Nothing

   

   Set oAttSer = 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.