Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 09-28-2007, 08:33 AM   #1 (permalink)
Junior Member

mitchgibbs's Avatar

Join Date: Oct 2006
Location: Chicago
Posts: 19
Rep Power: 0 mitchgibbs is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- API/VBA

Question Action VBA business rule

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?

Thanks!

Mitch
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

Old 10-11-2007, 11:26 PM   #2 (permalink)
o o o o o o o o o o o o o o o o o o

JeffMon's Avatar

Join Date: Aug 2006
Location: Charleston, SC
Posts: 54
Rep Power: 3 JeffMon is on a distinguished road

Blackbaud Products
- Raiser's Edge (RE)
- Financial Edge (FE)
- API/VBA

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
Enjoy!
-Jeff
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
actions, business rules, vba


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Cheap Electricity - Loans - Renegade Motorhomes - Mortgage
All times are GMT -6. The time now is 12:32 PM.

Miscellaneous


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by BBpixel Team 2008 :: jvbPlugin R1012.364.1

SEO by vBSEO 3.2.0 Copyright 2008 Blackbaud User SocietyAd Management by RedTyger
Inactive Reminders By Icora Web Design

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64