Tag Archives: Membership

Valid date to cannot be less than Valid date from when saving a Raiser’s Edge Membership record

Valid date to cannot be less than Valid date from

I got this error message the other day when developing with the membership module. In my opinion the membership module is the most complicated module to develop code for. Possibly because of this (and the fact that it is an optional module) there appears to be the least documentation about it. When I searched the knowledgebase for this error I did get a hit. It referred to NetSolutions. It suggested that the membership record did not have an expiry date.

This was not the case in my data. I had an activity date and an expiry date as required.

I worked out what the problem was. The issues happened when adding a membership card. I share this code between new memberships and a case where you may want to add a new membership card to an existing transaction. For a new membership card I was setting the card date as the same as the transaction date. The expiry date, by default was being set to the same as the membership’s expiry date. This worked fine for new memberships.

When I went to add a membership card to, say, a lapsed membership, (why this would happen in reality is uncertain but it was happening in my case), the start date was set to the transaction date i.e. today but the expiry date was in the past so the card’s expiry date was also in the past.

I checked for this scenario and set the membership card’s start date to one day before the expiry date if the expiry date was not after the start date.

Membership – Retrieving information

One very useful way of loading a collection of records is using the custom where clause. For example if you want to find a list of constituents who are born in a certain year you could write the following

Dim oRecords As New CRecords
oRecords.INIT SessionContext, tvf_record_CustomWhereClause, "BIRTH_DATE LIKE '1950%'"

This is the only really effective way of doing this without returning a list of all constituents filtering them in the code (much less efficient).

Continue reading Membership – Retrieving information