Biographical fields are blanked out when using VBA macro with SessionContext

When using a VBA macro with SessionContext and all solicit codes added to a constituent record, all the biographical information of the underlying record is cleared out and hence cannot be saved. 
We are currently evaluating this issue and will update this article when we have more information.

Steps to Duplicate

Please place the code below in the ‘System_Macros’ module, save it and then perform the following steps
  • Open any constituent record
  • Click on the Solicit code hyperlink to open the selection window on the lower left of BIO1 tab
  • Add all the solicit codes to the constituent
  • Click OK
  • Run the macro from the Run Macro button on the upper toolbar of the constituent form
Once the message box has closed you should see that the Biographical data has all been cleared. If you comment out the ‘oConstit.Init REApplication.SessionContext’ line, the code runs fine and the constituent data remains unaffected. The simple macro code is below.
 
Public Sub Test_SessionContext(oRec As IBBDataObject)
'Test Function
    If TypeOf oRec Is CRecord Then
        Dim oConstit As CRecord
        Set oConstit = oRec
        oConstit.Init REApplication.SessionContext
        If oConstit.SolicitCodes.Count > 0 Then
            MsgBox "This Constituent has Solicit Codes", vbOKOnly, "Message"
        Else
            MsgBox "This Constituent has no Solicit Codes", vbOKOnly, "Error"
        End If
        Set oConstit = Nothing
    Else
        MsgBox "This macro must be fired from a constituent record"
    End If
'End of Test Function
End Sub

Environment

 Raiser's Edge
 7.96

Was this article helpful?