Tag Archives: Constituent

Adding a primary constituent code

A SKY API task that is common but not obvious is adding a primary constituent code to a constituent record.

I say that it is not obvious because adding a first constituent code automatically makes it the primary. However adding a second does not change the first.

One way of doing it to remove the existing constituent code and add the second one followed by what was the first one. This is a highly unsatisfactory workaround.

The solution lies with the ‘sequence’ field. When creating your constituent code, set this value to 1 and this code becomes the primary.

Here is a sample payload :

{
  "constituent_id": "11278",
  "description": "Volunteer",
  "end": { "d": 13, "m": 11, "y": 2023 },
  "start": { "d": 12, "m": 01, "y": 2022 },
  "sequence": 1
}

This will put this constituent code at the top of the list and it will become the primary.

As an aside, working with constituent codes, it would seem possible to PATCH a constituent code description. After all you supply the id for the code, it seems reasonable then that you could simply change the code description. However, this is not possible. You do not get any kind of error message. Indeed the response is that everything has worked as expected. (but no change of code value)

Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 3 (Server back end)

This follows on from the second part of my guide to creating a donation from through SKY API…

The source code for this and the other parts of this series is available on Github.

In this part we are going to actually doing something with the donor details and their credit card.

We are using .NET on our server. You could use any language to do this but I am mostly familiar with working with .NET. I am going to assume here that you are either familiar with .NET or you are able to translate the concepts into your own language.

I created a new project in Visual Studio 2017. I chose an ASP.NET Web Application and selected the WebAPI option without authentication.  I added a new controller to my project – “Web API 2 Controller – Empty” called DonationController.

Continue reading Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 3 (Server back end)

Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 2 (Web front end)

This follows on from the first part of my guide to creating a donation from through SKY API…

The source code for this and the other parts of this series is available on Github.

Now we are going to focus on the web page that captures the donation.

We are going to show the minimum here. You will want to include data validation to ensure that the incoming data is valid. You will also want some form of security to ensure that you don’t end up sending a lot of spam into your Raiser’s Edge.

On this page we are making use of some simple html, some javascript and the Stripe Checkout API which makes an easy and PCI compliant way of capturing a credit card.

OK, Let’s begin!

Continue reading Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 2 (Web front end)

Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 1 (Overview)

This post is in response to a thread on the Raiser’s Edge User Group Support Forum on Facebook. If you are not already a member then I can highly recommend it. There are some very talented individuals there who have been using Raiser’s Edge for a long time and have a wealth of experience!

The question asked was whether anybody had created a donation form on a website which would capture information and send it through to RE NXT.

There are a number of different possibilities here. You could create a complex web application that captures donations like ones that are already commercially available e.g. Classy, Crowdrise, OneCause, FunRaise, 4AGoodCause, WeDidIt, MobileCause, FundRazr, etc to name a few to name the ones that Importacular currently integrates with. From an end user perspective these have a lot of functionality that makes donating an easier experience.

Continue reading Creating a Donation Form through SKY API into Raiser’s Edge NXT – Part 1 (Overview)

Working with RE7.95 and phone configuration rules

In v7.95 of RE7, there were some new config business rules introduced which prevent duplicate phone or emails being added to a record.

phone config

I have not really found this to be consistent though. When I use this inside of a constituent record it does not seem to make the slightest difference which setting. I can have to “Email” phone types but no matter which setting is selected above it saves fine. This does seem to work better with phones (as opposed to emails). Although even when I have the setting as “Do not allow record to be saved” it still prompts to if I want to save it.

When I run this through code however I do get an error… sometimes.

If I have a matching phone type but different phone number it seems to work fine most of the time (although once I got an error message). If I have a matching phone type and phone number I will always get the error as shown below. This does not seem to be affected by the options above though.

duplicate phone error

I am wondering wondering if there is a way of controlling the error. If this were working as expected then it should be possible to permit the record to be saved if the options is “Display warning”.

Here is my test code:

 Public Sub TestSavingDuplicatePhones()
 
        Dim constit As New CRecord
        constit.Init SessionContext             

        constit.LoadByField uf_Record_CONSTITUENT_ID, "3"
        
        Dim parent As IBBPhonesParent
        Set parent = constit        

        Dim phone As CConstitPhone
        Dim phones As CConstitPhones
        Dim dataObj As IBBDataObject
        Dim phone2 As CConstitPhone
        Dim dataObj2 As IBBDataObject
       
        For Each phone In parent.phones
            Set dataObj = phone
            If dataObj.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_PHONETYPE) = "Email" Then
                Set phones = parent.phones
                Set phone = phones.Add
                Set dataObj2 = phone
                dataObj2.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_NUM) = "1234"
                dataObj2.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_PHONETYPE) = "Email"                             

                Exit For
            End If
        Next       

        constit.Save        
        constit.Closedown
        Set constit = Nothing   
   End Sub

Working with Phones/Email without addresses in Raiser’s Edge 7.94

Prior to the release of The Raiser’s Edge version 7.94 I was working with all of our products to ensure compatibility with this latest version. If you have not heard (and if you have not heard where have you been hiding), this release of RE removes phones and emails from physical addresses.

When the concept of emails was new, it was possible that you would have an email address tied to your telephone provider or an email address specific to your place of work.  Your phone would either be at home or at work. Having these connnected to your physical address made sense. However it quickly became aparent that with the arrival of mobile phones and of email addresses that were accessible no matter where you were located, phones and emails (and for that matter all types of communication links) should be tied directly to the constituent record and not to a physical address. This is what has happened with the release of RE7.94.

This is a big shift and in terms of developing applications, we have had to allow for both possibilities so that our programs are compatible with users still on 7.93 and below and those that have made the leap over to 7.94.

The good news is that the old way of doing things still works in 7.94. You can still access phones via the CConstitAddress.Phones collection for an address. However you will probably want to access them how they are intended… Free from addresses.

This is done using the new interface IBBPhonesParent. This is implemented by CRecord, CIndividual2 and COrganization2. The collection of phones is a CConstitPhones object which contains the usual methods. You can iterate the collection to give you one CConstitPhone object but here is the problem.

For reasons that I don’t fully understand (I was told due to binary compatibility reasons) there are no properties or methods on the CConstitPhone object. Instead you have to convert this object to an IBBDataObject in order to access the Fields property. This is a real pain but to save myself some trouble I put together two extension methods for the CConstitPhone object which does this for me. (Unfortunately extension properties do not exist so that is why I cannot simply create an exact corresponding Fields properties. Those working with C# will be familiar with this as there is not a Fields property but rather  get_Fields and set_Fields methods)

<System.Runtime.CompilerServices.Extension()> _
Public Function Fields(ByVal phone As CConstitPhone, fieldConstant As ECONSTITPHONEFIELDS) As Object
   Dim dataobject As IBBDataObject = CType(phone, IBBDataObject)
   Return dataobject.Fields(fieldConstant)
End Function
<System.Runtime.CompilerServices.Extension()> _
Public Sub Fields(ByVal phone As CConstitPhone, fieldConstant As ECONSTITPHONEFIELDS, value As Object)
    Dim dataobject As IBBDataObject = CType(phone, IBBDataObject)
    dataobject.Fields(fieldConstant) = value
End Sub

With these extension method you can simply access the Fields methods on a CConstitPhone object in almost the same way as you would with other objects.

So here is an example of creating a new phone on a constituent record using the above extension code.

Dim constit As CRecord = GetConstituent()
Dim phonesParent As IBBPhonesParent
Dim phones As CConstitPhones
Dim phone As CConstitPhone

phonesParent = CType(constit, IBBPhonesParent)
phones = phonesParent.Phones
phone = phones.Add()
phone.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_PHONETYPE, "Home")
phone.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_NUM, "123-4567")
phone.Fields(ECONSTITPHONEFIELDS.CONSTIT_PHONES_fld_IS_PRIMARY, True)

constit.Save()
constit.CloseDown()
constit = Nothing

The Raiser’s Edge Integrated with Gmail… A series of case studies (1)

This is the first in a series of case studies looking at custom integration of Blackbaud products.

Unlike very many of our previous third party integration application the main driving force behind this application, Biographica, was the fact that we could do it. We did not have any particular client knocking on our door asking us link the two products and Google , funnily enough, did not approach us either asking us to develop an integration between The Raiser’s Edge and Gmail.

Continue reading The Raiser’s Edge Integrated with Gmail… A series of case studies (1)

Introducing RETweet Professional for The Raiser’s Edge

At the end of last year we released RETweet for all our newsletter subscribers (sign up to receive future offers and news). It was a great success allowing you to see your constituents’ Twitter feed directly from within The Raiser’s Edge. Now, with the release of RETweet Professional, you can search for any keyword, user or hashtag just as you would in Twitter. RETweet Professional brings you all the features of RETweet but also allows you to find out who is talking about your organisation and your mission. From the feed, RETweet Professional will look up the constituents using a fuzzy search [1], allow you create you own constituent if it cannot find it or you can search in RE using the regular search screen. The application gives you the option of connecting a Twitter user to a constituent and once you have done that you can save their tweet as a notepad. You can also set up a “love” attribute for use within RETWeet Professional. You can assign a value directly from the application and it will save onto the constiteunt record without you having to open it up.

Track the conversation that people are having about your organisation directly from within The Raiser’s Edge. Social media has been brought one step closer to your organisation.

Download RETweet Professional Demo (includes RETweet)

 

[1] On a technical note we are forced to do a fuzzy search as the only two identifying fields that we retrieve from Twitter are full name and location. We split up both of these fields into first and last name and city, state and country. For the location we attempt to see if the values we have assumed are in the code tables. If they are we know that we have assigned the values correctly. If they do not appear in the code tables then we do not assign the values on creating a constituent. When searching we give each term a weighting. Only constituents that match the last name or the first five characters of the organization name will ever appear in the fuzzy search results. After that each of the other terms’ weighting are added up to determine which results appear in the match. City and the full first name (as opposed to the person’s initial) are given a higher weighting so matches based on those values will appear more prominently.

Raiser’s Edge Integration with REST webservice

I have been working on a new version of RETweet which will be released soon. In that version we are allowing users to create constituents from Twitter users. The amount of information that you get from Twitter about the Tweet and the person that tweeted is very limited. The real name of the Twitter user – and it is not always a real name – is given in one field so it could include the first and last name (this is the most common where it is not a Tweeting business).  To make this more useful the application reaches out to a webservice to determine the gender of the person.

The webservice takes the first name and returns gender information and which countries the name appears in. The web service is biased towards European and Western first names but does claim to cover some countries in Asia too.

This could also easily be integrated as a VBA solution so that when you save and close a constituent record, if the gender is unknown the VBA code reaches out to the webservice and populates the code. Here is some sample code that shows you how this is done. This is done using .NET as it is considerably easier to achieve than in the native VBA environment. It would, however, be easy to make a call to a COM visible assembly from the native VBA client to call this method.

 

' Determines the gender of the person by looking up useing Thomas Bayer's webservice.
Private Sub SetGender(firstName As String, constit as CRecord) 

   Dim xdoc As XDocument
   Try
      'Here we retrieve the XML document from the REST web service
      xdoc = sendXML("http://www.thomas-bayer.com/restnames/name.groovy?name=" & firstName)

      Dim result = xdoc.<restnames>

      'if there is an error then the gender cannot be found
      If result.Descendants("error").Count > 0 Then
         Return
      End If

      'This is not an ideal check as a name can be both male and female
      'but for simplicity we assume this is not the case
      If resultresult.<nameinfo>.<male>.FirstOrDefault.Value.ToLower = "true" Then
         constit.Fields(ERECORDSFields.RECORDS_fld_GENDER) = "male"
      Else
         constit.Fields(ERECORDSFields.RECORDS_fld_GENDER) = "female"
      End If
      Catch
         'If there is an error due to the web service we catch it here and don't bother the end user.
      End Try

End Sub

Private Function sendXML(ByVal uri As String) As XDocument

   Dim request As HttpWebRequest
   Dim response As HttpWebResponse
   Dim reader As XmlReader

   request = HttpWebRequest.Create(uri)
   response = request.GetResponse()

   reader = XmlReader.Create(response.GetResponseStream())
   Return XDocument.Load(reader)

End Function

 

Look out for our new version of RETweet. It will include this and a lot of other new features!