1. Create a new Windows project in Visual Basic

2. Add a button named cmd1 to the form

3. Copy and paste the following code:

Option Explicit

Implements IBBAPIListenerCallback


Dim oList As CAPIListener

Private Sub cmd1_Click()


   Set RE7 = New REAPI

   RE7.Init "WRE11111", "Supervisor", "admin", , 50

   Dim oSC As IBBSessionContext

   Set oSC = RE7.SessionContext

   Set oList = New CAPIListener

   oList.Init oSC, Me


   Dim oConstit As CRecord

   Set oConstit = New CRecord

   oConstit.Init oSC

   'Load the record

   oConstit.Load 280

   'Save the record - The Save event will fire




   Set oConstit = Nothing


   Set oSC = Nothing

   RE7.SignOutOnTerminate = True

   Set RE7 = Nothing

End Sub

Private Sub IBBAPIListenerCallback_MetaObjectEvent(ByVal lObjectEvent As BBREAPI7.bbObjectEvents, ByVal lObjectType As BBREAPI7.bbMetaObjects, ByVal oMetaObject As BBREAPI7.IBBMetaField, bCancel As Boolean)

End Sub

Private Sub IBBAPIListenerCallback_ObjectEvent(ByVal lObjectEvent As BBREAPI7.bbObjectEvents, ByVal lObjectType As BBREAPI7.bbDataObjConstants, ByVal oDataObject As BBREAPI7.IBBDataObject, bCancel As Boolean)

   'lObjectEvent allows you to specify which event you want to listen for

   'lObjectType allows you to specify which Record type you want to listen for

   'both must be specified for the event to be fired.


   If lObjectEvent = bbOE_ObjectAfterSave And lObjectType = bbdataConstituent Then

       MsgBox "Save Event"

   End If


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.