I need to change a gift attribute based on the individuals' Classification on the Prospect tab.
Here are the specifics: I am importing gifts. I need to look at the existing constituent record (if available) and see if the Classification equals "Leadership." If it does, it changes an attribute description (category=GLCode) to 5678. If the prospect classification is not "Leadership' it is 1234.
I am pretty new to the API world. With this forum's help, I've figured out if/then/else statements but I don't know how to take this next step into looking at existing data, not just working with incoming data.
Can you share your solution with us so that it may help others with similar issue?
B
Barbara Daenzer
said
over 5 years ago
This is my coding. If a gift is $1000 or more, or the donor already has a Prospect Classification of 'Leadership,' the Campaign is set to 'Leadership' and the leadership general ledger code is applied (we store these in gift attributes). I love being able to look at existing information on a constituent record to update the incoming data--it opens up so many great possibilities.
Public Overrides Sub AfterConstituentOpen(ByVal oRec As Blackbaud.PIA.RE7.BBREAPI.CRecord, ByVal Cancel As ImportOM.API.iCancel) MyBase.AfterConstituentOpen(oRec, Cancel)
'define source column names Dim sGiftAmount = "AC"
'define virtual column names Dim vGiftID = "AO" Dim vGiftType =”AH”
'if gift amount (AC)>=1000 OR Donor is Leadership already then gift goes to Leadership campaign, otherwise Campaign (AH)=On-line If System.Convert.ToDecimal(GetColumn(sGiftAmount)) >= 1000 Then SetColumn(vGiftType, "Leadership") SetColumn(vGiftID, "0-140-4000-0-38") Else If Not orec.Prospect.Fields(Blackbaud.PIA.RE7.BBREAPI.EPROSPECTFields.PROSPECT_fld_CLASSIFICATION) Is Nothing AndAlso orec.Prospect.Fields(Blackbaud.PIA.RE7.BBREAPI.EPROSPECTFields.PROSPECT_fld_CLASSIFICATION).Equals("Leadership Donor") Then 'if giver is already a leadership donor SetColumn(vGiftType, "Leadership") SetColumn(vGiftID, "0-140-4000-0-38") Else SetColumn(vGiftType, "On-line") SetColumn(vGiftID, "0-140-4000-0-32") End if End Sub
Barbara Daenzer
I need to change a gift attribute based on the individuals' Classification on the Prospect tab.
Here are the specifics: I am importing gifts. I need to look at the existing constituent record (if available) and see if the Classification equals "Leadership." If it does, it changes an attribute description (category=GLCode) to 5678. If the prospect classification is not "Leadership' it is 1234.
I am pretty new to the API world. With this forum's help, I've figured out if/then/else statements but I don't know how to take this next step into looking at existing data, not just working with incoming data.
Thanks for your help!