I have a data form extension I've added to extend the constituent summary profile view form. In addition to wanting to add a few new fields to the form in true extension spirit, I also want to change the value of the OOB RELATEDCONSTITUENT (Spouse) field to equal the value from the extension form since we want to be able to see the name of a deceased spouse if one should exist, rather than nothing. I've followed the instructions in the SDK resources to a T and still am having no luck getting this to work. The instructions are a bit different because they instruct on how to influence a field in the extension form based on the change to a field in the parent form. Since I am working with two view forms, nothing ever changes, but I can't seem to find a method that would be the ParentModel equivalent of LoadedEventArgs. This is probably something simple and stupid, but does anyone have any experience getting a similar scenario to work? The following is my code:
Imports Blackbaud.AppFx.Constituent.UIModel
Public Class ConstituentSummaryProfileExtensionViewCustomUIModel
Private _parentmodel As ConstituentSummaryProfileViewFormUIModel
Private Sub ConstituentSummaryProfileViewFormUIModel_HostModelChanged(ByVal sender As Object, ByVal e As Blackbaud.AppFx.UIModeling.Core.lo) Handles Me.HostModelChanged
If _parentmodel Is Nothing Then
_parentmodel = DirectCast(Me.HostModel, ConstituentSummaryProfileViewFormUIModel)
End If
If Me.HostModel IsNot Nothing Then
AddHandler _parentmodel.RELATEDCONSTITUENT.ValueChanged, AddressOf RELATEDCONSTITUENT_ValueChanged
Else
RemoveHandler _parentmodel.RELATEDCONSTITUENT.ValueChanged, AddressOf RELATEDCONSTITUENT_ValueChanged
End If
End Sub
Private Sub RELATEDCONSTITUENT_ValueChanged(ByVal sender As Object, ByVal e As Blackbaud.AppFx.UIModeling.Core.ValueChangedEventArgs)
Dim spouse = Me.RELATEDCONSTITUENT.Value.ToString
If _parentmodel.RELATEDCONSTITUENT.Value = Nothing Then
_parentmodel.RELATEDCONSTITUENT.Value = spouse
End If
End Sub
End Class