Private Sub BatchVBARecord_BeforePostRecord(ByVal sBatchName As String, ByVal lBatchType As bbVBABatchTypes, oDataObject As Variant, bcancel As Variant, sExceptionMessage As Variant)

Dim oPayment As CGift

Set oPayment = oDataObject

   MsgBox "You are about to see the original Pledge for this payment. Upon closing out, the payment will appear"

   Dim oPledge As CGift

   Set oPledge = New CGift


   Dim oGiftform As CGiftForm

   Set oGiftform = New CGiftForm

   oGiftform.Init REApplication.SessionContext


   Dim lPledgeID As Long


   If oPayment.PledgePayer.PledgeId(1) > 0 Then

   'find the id of the original pledge

   lPledgeID = oPayment.PledgePayer.PledgeId(1)


   With oPledge

       .Init REApplication.SessionContext

       .Load lPledgeID

   End With

   'set the form to the pledge and show it

   Set oGiftform.GiftObject = oPledge

   oGiftform.ShowForm True


   'clean up


   Set oPledge = Nothing

End If

'clean up

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