RE-Decoded

A technical look at the Raiser’s Edge API from Blackbaud

Filtering Individual Relationships

August 14th, 2008 by David Zeidman

In my endeavour of documenting the undocumented I would like to present this little nugget of an unwritten feature. I wanted to filter a constituent’s individual relationship based on a reciprocal type and on the to date not being populated i.e. the relationship was still valid. I’ll use the filter object I thought.

I wrote the following code:

Dim inds As CIndividuals2 = Nothing
Dim ind As CIndividual2 = Nothing
Dim indsFilter As CIndRelFilter

inds = New CIndividuals2
inds.Init(REUtil.getSessionContext, constit.Fields(ERECORDSFields.RECORDS_fld_ID), _ &
TopViewFilter_Individual2.tvf_Ind2_UseFilterObject, , False)
indsFilter = inds.FilterObject
indsFilter.ReciprocalRelationshipType = "Friend"
indsFilter.DateTo = ""

For Each ind In inds
'do something
Next ind

This didn’t work. It just returned all the “Friend” relationships. I noticed that the actual value of the blank to date field is “Nothing” so I tried:

indsFilter.DateTo = Nothing

But no luck.

After a quick email to Blackbaud support I was informed that the DateTo filter does not support blank values. So there you go…Now it is documented somewhere at least.

What is the workaround? In this case use the custom where clause to check for a null date and compare against the table entry for the “Friend” entry. Not nearly as neat as using the filter object.

inds.Init REApplication.SessionContext, 280, tvf_Ind2_CustomWhereClause, "Date_To IS Null AND Recip_Relation_Code = X"

Here X is the table entry id for “Friend”

Related posts:

  1. Filtering on Gifts One common complaint about the API is that it is...
  2. Old and New Relationships The other day I was trawling the knowledgebase for some...
  3. Static, Dynamic and User-defined code table entries I regularly use the API help file and the code...
  4. Filtering and Sorting Participants - Just not Together This is being written in response to two hours of...

Posted in Intermediate |

Leave a Comment

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.