Public Sub AddPrimaryEducationAttribute()

'This procedure adds an attribute to the primary education

'of a constituent record

   Dim oEducation As CEducation2

   Dim oATS As CAttributeTypeServer

   Dim oServices As REServices

   Dim lAttributeID As Long


   'Need the following code to get the AttributeTypeID

   Set oServices = New REServices

   oServices.Init REApplication.SessionContext

   Set oATS = oServices.CreateServiceObject(bbsoAttributeTypeServer)

   oATS.Init REApplication.SessionContext

   'Change text in following code to match your custom attribute

   lAttributeID = oATS.GetAttributeTypeID("Clubs", bbAttributeRecordType_EDUCATION)


   Set oATS = Nothing

   Set oServices = Nothing


   Set oEducation = New CEducation2

   oEducation.Init REApplication.SessionContext

   '280 is the system record id of the constituent

   oEducation.LoadPrimaryAlumni 280


   With oEducation.Attributes.Add

       .Fields(Attribute_fld_ATTRIBUTETYPES_ID) = lAttributeID

       .Fields(Attribute_fld_VALUE) = "Band"

   End With




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