Need to ResetDataSource conditionally in within a Collection

I have an EditDataForm spec. I am trying to rebind a FormField named EDUCATIONALHISTORYID that uses a simple data list when the CONSTITUENTID field is updated. The simple data list takes CONSTITUENTID as a parameter. I have code to do this when the when the UIFieldChanged event fires. This causes a loop, the event fires correctly when the CONSTITUENTID is changed, and then it updates EDUCAITONALHISTORYID which causes it to fire again and begin looping.

I need a way to know that it was the CONSTITUENTID field that was changed, or some other solution.

Public Class BulkEditFundRecipientDataFormUIModel

Private Sub BulkEditFundRecipientDataFormUIModel_UIFieldChanged(sender As Object, e As UIFieldChangedEventArgs) Handles Me.UIFieldChanged

For Each m In DESIGNATIONRECIPIENT.Value

If m.Selected = True Then

m.EDUCATIONALHISTORYID.ResetDataSource()

End If

Next

End Sub

End Class

Normally I would just debug, and peer into “e” and see what I’ve got. Unfortunately in my current situation I have no debugging ability.

Comments

  • You should be able to handle CONSTITUENTID.ValueChanged instead of Me.UIFieldChanged. This will only fire when constituent id changes instead of when anything changes.

    Edit: Inside the collection field's UI model.

  • Thanks Harry. This is helpful and makes sense. Normally I would just debug, and peer into “e” and see what I’ve got. Unfortunately in my current situation I have no debugging ability. Any idea who to peer into the collection fields UI model. That is the crux of my issue, is I don't know how to look into the fields inside my collection and detect what has changed. Wish I could debug to explore these objects see what the heck is going on. For now I am looking for a clear and correct way to expose and use the child elements in a collection.

  • There should be another Class called BulkEditFundRecipientDataFormDESIGNATIONRECIPIENTUIModel that dictates the interface for the collection field. Inside there you can put your handlers for its fields. Other than that, I recently answered my own question about how to look into the collection field using ListChanged.

    Is there any particular reason that you are unable to debug and check?

  • Thanks Harry. I will give this a try.


    Regarding debugging, I do not have Blackbaud CRM installed locally on my development box. I need to debug using a shared DEV server, but cannot see or connect to worker processes on that server. I'm working with our admins to open up the correct ports and get access to do this.


    Thanks again for the help. It's truly appreciated.


    Ernie
  • Harry, Just FYI. This worked like a champ. Thank you. Ernie

  • Awesome! Glad to help.