December 5th, 2012 by
David Zeidman
One of the benefits of using VBA or VB6 (probably one of the very few benefits) is the ability to easily debug code. Not that it is too difficult to debug using .NET but there are a couple of tricks that you need to know. When using VBA from within RE7 you need to do very little other than set a break point where it is needed. Using VB6 plug-ins you used to be able to just run the project and start the document (until, that is Internet Explorer stopped supporting the running of these component directly).
In .NET it is not as straight forward. Either you have to create a little application that starts the form that you are using for plug-ins or for “VBA” style macros and event based customisations you need to ensure all your files are in the RE7 plugin or custom directory and attach Visual Studio to the RE7.exe process. This is done using the Tools menu item “Attach to Process”. In the list you find RE7.exe and as long as you are loading the same version of the file in RE7 as you have open in Visual Studio you are able to debug.
One of the problems with this is that it becomes slightly difficult to debug events that happen on opening of RE7 i.e. in the application start events. It is possible that you can be quick and start the Attach to Process item and select RE7 before the application has reached the custom code but it is a pain.
What is more it seemed to me that there must be a way of automating this process so that it would be much quicker. Well I got out my automation handbook and started to program (I don’t actually have an automation handbook). I put together the following macro which does the trick. I then assigned the shortcut CTRL-ALT P (you could assign whatever you like but this is one that I assigned previously to open up the attach to process window).
Sub AttachToRE7()
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(2) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("T-SQL")
dbgeng(1) = trans.Engines.Item("Managed (v2.0, v1.1, v1.0)")
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, My.Computer.Name).Item("RE7.exe")
proc2.Attach2(dbgeng)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
Posted in Advanced |
Comments Off
March 2nd, 2011 by
David Zeidman
I have been developing some updates for The Mergician. There are some nice additions coming soon including clean up of duplicate attributes and appeals following the merge. However one item that has been added is the request to select a record as the primary constituent if it has a NetCommunity Login associated with it. Read the rest of this entry »
Posted in Advanced |
Comments Off
January 21st, 2011 by
David Zeidman
When I wrote an article a while back about the setting up a non-production database, I thought that I had the registry and how Blackbaud use it well understood. Of course that was before Vista, Windows 7 and elevated admin rights.
Read the rest of this entry »
Posted in Advanced, Not Code |
Comments Off
November 4th, 2010 by
David Zeidman
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. Read the rest of this entry »
Posted in Advanced |
8 Comments »
September 30th, 2010 by
David Zeidman
Most people who regularly read this blog will hopefully (for their sake) never have to encounter this issue that has plagued me ever since I upgraded to Visual Studio 2005 (and then later Visual Studio 2008) and Vista (and then later Windows 7). Working with setup and deployment project is supposed to make life easier but I have had nothing but trouble with them.
Read the rest of this entry »
Posted in Advanced |
Comments Off
August 26th, 2010 by
David Zeidman
As I mentioned in a previous post I have been working on some sample demonstration material for The Blackbaud Conferences in London and Washington DC. I got a timeout error previously on saving data in a custom form. I was able to fix it entirely by fluke without knowing how I did it. However now I have got it again and it has been driving me crazy.
Posted in Advanced |
Comments Off
August 5th, 2010 by
David Zeidman
I am currently working on a project where I need to copy a gift record from one constituent to another. There are 213 fields on the regular gift object i.e. CGift. That is without looking at any of the other areas of the gift such as attributes, notepads, etc. It would take a lot of typeing to copy between each field so to do this I use the meta data that is supplied with each object. Read the rest of this entry »
Posted in Advanced |
2 Comments »
February 26th, 2010 by
David Zeidman
In an earlier post I looked at the way in which it is possible to open up a Crystal Report from VB or VBA code in The Raiser’s Edge. That was with version 8.5 of Crystal Reports. I tried to do the same thing recently with a report created in Crystal Reports 11 and the code broke. I rewrote the code using a newer object and technique.
Read the rest of this entry »
Posted in Advanced |
1 Comment »
January 20th, 2010 by
David Zeidman
One of the methods for writing VBA code that fires when, say a constituent is saved, is to write a VBA DLL. I have covered this previously so I won’t go into details in this post. However what do you do if you need one VBA DLL to talk to another one? For example if I make a change to a record in one VBA DLL and have installed Zeidman Development’s Audit Trail application (excuse me for the gratuitous plug there) how do I tell the audit trail to make a note of this change? The VBA events are only fired when the Raiser’s Edge GUI opens up or saves a record and not when the code does so.
Read the rest of this entry »
Posted in Advanced |
Comments Off
December 11th, 2009 by
David Zeidman
Custom where clauses are a great way of filtering the results of all the top object collections (where the method exists). However there are some pitfalls. One such pitfall can be found when you try to write sub selects to link to other tables. For example, say you want to find all the individual relation records that have the surname “Zeidman” and are spouses. You would write a sub select in the custom where clause as shown below:
Read the rest of this entry »
Posted in Advanced |
Comments Off