We are a group of users of Blackbaud products and are not affiliated with Blackbaud. We'd love to have you join our community to help and be helped in getting the most from your Blackbaud software.
Register now to join us to get independant advice on your system, connect with 3rd party consultants to help you maximize your database and have a real alternative to the official Blackbaud website.
We've got a recurring problem with users incompletely closing Actions. They're very good about checking the Completed box, but we also use Status to indicate whether the Action was actually Completed or Cancelled.
We wrote some VBA to check if either the Completed box is checked and the Status is still Outstanding or if the Status is changed to Completed or Cancelled but the Completed box is unchecked. It works just great.
However, if staff use Action Reminders on the Home screen, they can check the Completed box and the rule is never triggered.
Any recommendations on how to achieve our aim here?
Hi Mitch, you could use the cAPIListener to listen for the save event, then process the action however you like. You'll need to create a small class in VBA, then instantiate the class (and tell it to start listening) when the user connects and stop the class when the user disconnects. Here is the class code
Code:
'----------------this class is named cListener------------------
Public WithEvents moListener As CAPIListener
Private mbInSave As Boolean
Public Sub StartListening(ByVal oSC As IBBSessionContext)
Set moListener = New CAPIListener
moListener.Init oSC
End Sub
Public Sub StopListening()
moListener.CloseDown
Set moListener = Nothing
End Sub
Private Sub moListener_ObjectEvent(ByVal lObjectEvent As BBREAPI7.bbObjectEvents, ByVal lObjectType As BBREAPI7.bbDataObjConstants, ByVal oDataObject As BBREAPI7.IBBDataObject, bCancel As Boolean)
If lObjectType = bbdataAction And Not mbInSave Then
If lObjectEvent = bbOE_ObjectSaved Then
Dim oAction As CAction
Set oAction = oDataObject
MsgBox "Holy Frijoles, someone just saved this action: '" & oAction.Fields(ACTION_fld_DESCRIPTION) & "'!"
If oAction.Fields(ACTION_fld_COMPLETED) Then
oAction.Fields(ACTION_fld_STATUS) = "Complete" '<-- enter your correct new status here
mbInSave = True
oAction.Save
mbInSave = False
End If
Set oAction = Nothing
End If
End If
End Sub
'----------------END class cListener------------------
Here are some VB procs that show how to start and stop the listener. You'll want to do it on connect and disconnect for a regular user, but you can use these to start and stop the listener while you're debugging it:
Code:
'Put these in your System_Macros or somewhere, but NOT in the class above:
Private moListener As cListener
Public Sub StartListener()
Set moListener = New cListener
moListener.StartListening REApplication.SessionContext
End Sub
Public Sub StopListener()
If Not moListener Is Nothing Then
moListener.StopListening
Set moListener = Nothing
End If
End Sub