Notices


Reply
 
LinkBack Thread Tools Display Modes

Old 10-26-2007, 03:49 PM   #1 (permalink)
Crystal Reports Guru

DrewAllen's Avatar

Join Date: May 2006
Location: Philadelphia, PA
Posts: 1,154
Rep Power: 4 DrewAllen is on a distinguished road

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

First VBA Project

I just finished the VBA/API class for RE. This is the second time that I have taken this class. I seemed to grasp things much better this time around. I think that there are a number of reasons for this. I won't go into them here.

I decided to try my hand at this so that my skills wouldn't get rusty. We'd had a couple of projects on hold, because they would require some VBA. I decided to start with the easiest of these.

In the Raiser's Edge, you can make some fields mandatory. We wanted to make the first name mandatory on constituents, but setting this in RE also makes it mandatory on individual relationships. This caused problems, because we did not always know both of the first names when there was a couple, but we wanted to use the spouse's title when creating Addressees and Salutations.

In brief, make the first name mandatory on individual constituents, but optional on non-constituent individual relationships. There are actually two parts, both of which are very similar. The first was when creating constituents and the second was for changing a non-constituent individual relationship into a constituent. I used the "RE Code Wizard" to create a Constituent_BeforeSave() event and an Individual_BeforeSave() event. I then replaced the

Code:
 'bCancel = < place your custom save criteria here >
 
with the following code:
Code:

        bCancel = _
            oConstituent.Fields(RECORDS_fld_KEY_INDICATOR) = bbKeyIndicator.bbki_INDIVIDUAL _
            And oConstituent.Fields(RECORDS_fld_FIRST_NAME) = ""
            
        If bCancel Then MsgBox "The first name is required for constituents!"
 
There are two conditions: I first have to check to make sure that the record is an individual (and not an organization) and then I have to check whether the first name is blank. If it meets both of these conditions, then I raise a message box with the error.

The Individual relationship is similar, but I already know it is an Individual, what I need to check is whether it is a constituent.

It works beautifully.

Drew
__________________
J. Drew Allen
Children's Hospital of Philadelphia

Crystal Reports and SQL Server Consultant

It is better to live your destiny imperfectly than to live an imitation of somebody else's life with perfection.

Last edited by DrewAllen; 10-26-2007 at 03:55 PM.
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
getting started, 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


Rent Games - Cheap Gas - Loans - Phoenix Pools
All times are GMT -6. The time now is 11:33 AM.

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