If you are using VB6 then you are possibly somewhat limited as to the way you can document your code and then have it published automatically. (I say that from complete ignorance and somebody is very welcome to show me otherwise). However in VB.NET and C# there is the built in XML documentation. In both languages you simply place the cursor the line above the field, property, method or class that you wish to document. In VB.NET you type: Continue reading Documenting VB.NET and C# Code
Tag Archives: VB.Net
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!
A .NET Fix
This post is totally unrelated to The Raiser’s Edge and the API but in case others are having the same issue I wanted to describe how I fixed it. I have just spent the last several hours trying to get the progress bar to scroll in the marquee style. I had seen several posts referring to using a background worker to retrieve data from the database while the progress bar scrolled in the UI thread. It sounded like the right solution but it didn’t make a difference.
I read one post that helped. It said that before you instantiate your form you need to enable the visual styles.
Application.EnableVisualStyles()
When I ran my application all of a sudden not only was my progress bar scrolling nicely but all of a sudden I could see the graphical styles that I always had seen in Visual Studio but never experienced in my Winform applications.
Customizations, SDKs and API’s, Oh RE
If you recognise the title of this post then I was inspired by a BlackbaudKnowHow article of a similar name. In that article the author describes the differences between the three terms and how they relate to Blackbaud Enterprise CRM. This is a good overview and works well for Blackbaud Enterprise CRM. However it breaks down when talking about The Raiser’s Edge 7.
Bank Checking Software Compared
I have been working with different bank checking software. Blackbaud Europe have written a plug-in for The Raiser’s Edge to update the bank record data such as the name and branch of the bank as well as the address based on the sort code. We recently developed a plug-in that processed the direct debit returns and unpaids from BACS and update the recurring gifts accordingly. In some cases a new bank would need to be created. I was asked to integrate the plug-in with their Blackbaud written plug-in.
Subtle changes in Visual Studio 2010 make Raiser’s Edge API less typing
I have been using Visual Studio 2010 for a short while now ever since the prospect of developing workflows for Enterprise CRM became a reality. One thing that I noticed when working with The Raiser’s Edge API however is that it is much faster to type out everything.
Continue reading Subtle changes in Visual Studio 2010 make Raiser’s Edge API less typing
A Raiser’s Edge C# Plugin
A few days ago I put a question on both Blackbus and the official Blackbaud forums asking if anybody had written a plug-in in C#. I have written a number of customisations in C# (VB.NET is my most common programming language – although I do enjoy using C#) but I had never written a plug-in before. It has always been a web service of application of some kind. I managed to work out how to do it and thought that I would share my solution here. Continue reading A Raiser’s Edge C# Plugin
C# API Try Catch Finally Snippet
I have been doing some work with C# recently and decided that despite what people say C# is as equally verbose as VB.NET. It is true if you look at the number of characters in a VB program compared to the equivalent C# program there will be a greater number but you seem to get a lot more automatic inserts with VB than you do with C#. C# seems to have a lot more punctuation that VB too adding up to a lot more typing than I was used to.
The Raiser’s Edge API: VB.NET versus C#
I am sure that there are a many people out there who still use VB6 when working with The Raiser’s Edge API but it is more and more common that you need to write .NET code and indeed want to write .NET code. There are several reasons for this but for me it is simply that the Visual Studio 2008 is a thousand time better than the VB6 development environment. I cringe every time I have to go back to a piece of old code or to the VBA environment. What really interests me is the choice of VB.NET or C# for development.
The Case of the Missing Tabs
Here is a strange problem that I encountered. I wanted to show the constituent form with constituent data. I also wanted to know if the user had saved and closed or just closed the form afterwards. If I had not been interested in knowing this information then I would have simply done the following: Continue reading The Case of the Missing Tabs