Public Sub SpouseConstituentAdd()

Dim oIndividual As CIndividual2


Set oIndividual = New CIndividual2

With oIndividual

   .Init REApplication.SessionContext

   .Fields(INDIVIDUAL2_fld_CONSTIT_ID) = 663 'Record ID of Constituent

   .Fields(INDIVIDUAL2_fld_RELATION_ID) = 665 'Record ID of Spouse who is a Constituent


   .Fields(INDIVIDUAL2_fld_RELATION_CODE) = "Spouse"

   .Fields(INDIVIDUAL2_fld_RECIP_RELATION_CODE) = "Spouse"

   'Note:  If the spouse flag is set prior to any address changes

   '       then this relation's address will automatically be linked

   '       to Angela Diresta's preferred address

   .Fields(INDIVIDUAL2_fld_IS_SPOUSE) = bbTrue



End With

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