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:
Public Sub testing()
Dim oRec As CRecord
Set oRec = New CRecord
oRec.Init SessionContext
oRec.LoadByField uf_Record_CONSTITUENT_ID, "3"
Dim ofrmConstit As New CConstituentForm
ofrmConstit.Init SessionContext
Set ofrmConstit.ConstituentObject = oRec
ofrmConstit.Show vbModal
ofrmConstit.CloseDown
Set ofrmConstit = Nothing
oRec.CloseDown
Set oRec = Nothing
End Sub
This works as expected without any problems. (However if you write the equivalent code in VB.NET you (me only?) do get some strange fonts)
This does not allow us to determine whether or not the user has cancelled so there is a different method that we can use that is very useful:
Public Sub testing()
Dim oRec As CRecord
Set oRec = New CRecord
oRec.Init SessionContext
oRec.LoadByField uf_Record_CONSTITUENT_ID, "3"
Dim ofrmConstit As New CConstituentForm
ofrmConstit.Init SessionContext
Set ofrmConstit.ConstituentObject = oRec
If ofrmConstit.ShowFormOKCancel() = False Then
MsgBox "Cancelled"
End If
ofrmConstit.CloseDown
Set ofrmConstit = Nothing
oRec.CloseDown
Set oRec = Nothing
End Sub
Now when the window is opened it is missing certain tabs, as shown below.
These tabs have one thing in common. They all represent child top level objects on the constituent record e.g. actions, gifts, events, etc. The code does determine whether or not save and close was pressed but clearly there are some tab issues.
Blackbaud are looking into it… Watch this space for updates
If you display the constituent form with a new record (i.e. init, don’t load, then set some fields), how can you detect whether the user selected a duplicate record upon saving? Whenever I try it via the API, RE saves the constituent as a new record whether the user selected a duplicate or not.
As a follow-on to my previous comment, if the user did select a duplicate, how do you determine which duplicate the user selected?