Public Sub PostAdjustedGift()

   Dim oRec As CRecord

   Set oRec = New CRecord

   oRec.Init REApplication.SessionContext

   

   oRec.Load 187

   

   Dim oGift As CGift

   

   For Each oGift In oRec.Gifts

       Dim oAdj As IBBAdjustment

       For Each oAdj In oGift.Adjustments

           'Check to see if the adjustment is posted or not

           If oAdj.Fields(ADJUSTMENT_fld_Post_Status) = "Not Posted" Then

               Dim oAdjs As CAdjustmentServer

               Set oAdjs = New CAdjustmentServer

               oAdjs.Init REApplication.SessionContext, oGift

                'Used the AdjustmentServer .Edit Adjustment to change the post status

               With oAdjs

                   

                   Set oAdj = .EditAdjustment(oGift.Adjustments.Item(1))

                   With oAdj

                       .Fields(ADJUSTMENT_fld_Post_Status) = "Posted"

                   End With

                   'Save the adjustment change

                   .Save

                   .CloseDown

               End With

               Set oAdjs = Nothing

           End If

       Next oAdj

       Set oAdj = Nothing

   oGift.CloseDown

   Next oGift

   

   Set oGift = Nothing

   

   oRec.CloseDown

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