Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 07-15-2008, 06:52 PM   #1 (permalink)
Junior Member

Join Date: Jul 2008
Location: Melbourne, Australia
Posts: 5
Rep Power: 0 mflitman is on a distinguished road

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

Dropping Memberships

Hi
This is my 1st post.
I am wanting to drop a constituent's membership using vba.
There is a previous post Adding and renewing memberships via RE API but I can't download the code in the link.

I started with the following code but am getting a bit lost in using the objects.
Is this the way to go?
In the following code, I can't set objMemDataHelper = objData (type mismatch)
What am I doing wrong?

Dim objMembership As CMembership
Dim objCurrMembershipTrans As CMembershipTransaction
Dim objData As IBBDataObject
Dim objMemDataHelper As IBBMemberDataHelper

For Each objMembership In objConstit.Memberships
Set objCurrMembershipTrans = objMembership.CurrentTransaction
Set objData = objCurrMembershipTrans
Set objMemDataHelper = objData ????
objMemDataHelper.Init REApplication.SessionContext
objMemDataHelper.DropAllMemberships (objData)

Any help gratefully received.
Thanks,
Malcolm
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 07-16-2008, 06:56 AM   #2 (permalink)
Likes to customize RE!

DavidZ's Avatar

Join Date: Jul 2006
Location: London, UK
Posts: 335
Rep Power: 3 DavidZ is on a distinguished road

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

Malcolm,

The objData object does not implement the IBBMemberDataHelper interface. In fact as far as I can see the only object to implement this interface is the CMemberDataHelper which you can create in the normal way.

Code:
 
Dim memDataHelper as New CMemberDataHelper
Dim objMemDataHelper As IBBMemberDataHelper
 
Set objMemDataHelper = memDataHelper 
objMemDataHelper.Init REApplication.SessionContext
 
 
'Here you can work with the mem data helper interface
 
objMemDataHelper.Closedown
Set objMemDataHelper.Closedown
Set memDataHelper = Nothing
It is interesting that Blackbaud have decided to have an object whose sole purpose is to be implemented by an interface. Even the init and closedown methods are in the interface which is really unusual. It makes me think that the actual implementation of the CMemberDataHelper object has other methods that are hidden for the API version.
__________________
David Zeidman
Zeidman Development
http://www.zeidman.info

Check out my RE API blog
http://www.re-decoded.com

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 07-16-2008, 06:10 PM   #3 (permalink)
Junior Member

Join Date: Jul 2008
Location: Melbourne, Australia
Posts: 5
Rep Power: 0 mflitman is on a distinguished road

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

Thanks for that David, but I still can't seem to get it to work.
My code is:

(a valid objConstit declared as CRecord is passed in)
Dim objIBBDataObject As IBBDataObject
Dim memDataHelper As CMemberDataHelper
Dim objMemDataHelper As IBBMemberDataHelper

Set memDataHelper = New CMemberDataHelper
Set objMemDataHelper = memDataHelper
objMemDataHelper.Init REApplication.SessionContext
Set objIBBDataObject = objConstit
objMemDataHelper.DropAllMemberships (objIBBDataObject)

The last line produces the "Object doesn't support this property or method" message

If I can't get this to work, I may need to go back to the drawing board and create a "Drop" transaction"
Have you done similar before?

Thanks for your help.
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 07-17-2008, 09:17 AM   #4 (permalink)
Likes to customize RE!

DavidZ's Avatar

Join Date: Jul 2006
Location: London, UK
Posts: 335
Rep Power: 3 DavidZ is on a distinguished road

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

I have never actually used this before so I cannot comment as to whether it works or not. However I have dropped members before. I guess this is just a convenience method that allows you to enter a constituent instead of going through each member. From what I could remember you take the membership record, add a new transaction of type dropped and supply a reason. You will need to do this for all the membership records on the constituent.

David
__________________
David Zeidman
Zeidman Development
http://www.zeidman.info

Check out my RE API blog
http://www.re-decoded.com

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 07-17-2008, 10:55 AM   #5 (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

Try this:

Code:
Public Sub DropMembership()
    Dim oC As CRecord
    Set oC = New CRecord
    oC.Init REApplication.SessionContext
    oC.Load 559 '<-- Constit system ID
    
    Dim oMemHelp As CMemberDataHelper
    Set oMemHelp = New CMemberDataHelper
    Dim oIMemHelp As IBBMemberDataHelper
    Set oIMemHelp = oMemHelp
    oIMemHelp.Init REApplication.SessionContext
    oIMemHelp.DropAllMemberships oC
    oIMemHelp.Closedown
    oC.Closedown
    Set oC = Nothing
End Sub
No need to fool around with the IBBDataObject, you can just pass in the cRecord object and it will be cast appropriately.

HTH, 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

Old 07-17-2008, 05:46 PM   #6 (permalink)
Junior Member

Join Date: Jul 2008
Location: Melbourne, Australia
Posts: 5
Rep Power: 0 mflitman is on a distinguished road

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

Thanks for that Jeff. I got DropAllMemberships to work but also want to put in a reason. Am now using the following code:

For Each objMembership In objConstit.Memberships
Set objCurrMembershipTrans = objMembership.CurrentTransaction
If objMembership.CurrentTransaction.Fields(MEMBERSHIPTRANSACTION_fld_Type) <> "Dropped" And _
objMembership.CurrentTransaction.Fields(MEMBERSHIPTRANSACTION_fld_Category) <> "Lifetime" Then
lCategory = objMembership.CurrentTransaction.Fields(MEMBERSHIPTRANSACTION_fld_Category)
sProgram = objMembership.CurrentTransaction.Fields(MEMBERSHIPTRANSACTION_fld_Program)
Set objNewMembershipTrans = objMembership.Transactions.Add
With objNewMembershipTrans
.Fields(MEMBERSHIPTRANSACTION_fld_Type) = "Dropped"
.Fields(MEMBERSHIPTRANSACTION_fld_Reason) = sReason
.Fields(MEMBERSHIPTRANSACTION_fld_Category) = lCategory
.Fields(MEMBERSHIPTRANSACTION_fld_Program) = sProgram
.Fields(MEMBERSHIPTRANSACTION_fld_ActivityDate) = Date
End With
objMembership.Save
Set objNewMembershipTrans = Nothing
objConstit.Save
Set objConstit = Nothing
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


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 - Cheap Gas - Credit Cards - Loans
All times are GMT -6. The time now is 12:29 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