Public Sub AddIndRel()

'Load Robert Hernandez

Dim oCon As CRecord

Set oCon = New CRecord

oCon.Init REApplication.SessionContext



oCon.LoadByField uf_Record_CONSTITUENT_ID, 96



Dim lId As Long

lId = oCon.Fields(RECORDS_fld_ID)



'load Joseph Diresta

Dim oCon2 As CRecord

Set oCon2 = New CRecord

oCon2.Init REApplication.SessionContext



oCon2.LoadByField uf_Record_CONSTITUENT_ID, 1



Dim lID2 As Long

lID2 = oCon2.Fields(RECORDS_fld_ID)



Dim oIndRel As CIndividual2

Set oIndRel = New CIndividual2



With oIndRel

   .Init REApplication.SessionContext

   

   .Fields(ORGANIZATION2_fld_CONSTIT_ID) = lId

   .Fields(ORGANIZATION2_fld_RELATION_ID) = lID2

   

   .Save

End With





oIndRel.CloseDown

Set oIndRel = Nothing



oCon2.CloseDown

Set oCon2 = Nothing



oCon.CloseDown

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